Drag-and-drop attachment links from file download control to Operating System to download


<xp:scriptBlock>
<xp:this.value><![CDATA[dojo.query(".xspLinkFileDownload").forEach(
function(node, index, arr) {
dojo.attr(node, "draggable", "true");
dojo.attr(node, "ondragstart", "event.dataTransfer.setData('DownloadURL', 'application/octet-stream:" + node.innerText + ":" + node.href + "')");
}
);]]></xp:this.value>
<xp:this.loaded><![CDATA[${javascript:context.getUserAgent().isChrome() && @Attachments() != 0}]]></xp:this.loaded>
</xp:scriptBlock>
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...