diff --git a/lib/client/listeners.js b/lib/client/listeners.js index de9fec16..e870ebe2 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -129,16 +129,18 @@ var Util, DOM, CloudCmd; */ lOnDragStart_f = function(pEvent) { var lElement = pEvent.target, + EXT = 'json', + isDir = DOM.isCurrentIsDir(), lLink = lElement.href, lName = lElement.textContent; /* if it's directory - adding json extension */ - if( DOM.isCurrentIsDir() ){ - lName += '.json'; - lLink += '?json'; + if (isDir) { + lName += '.' + EXT; + lLink += '?' + EXT; } - pEvent.dataTransfer.setData("DownloadURL", + pEvent.dataTransfer.setData('DownloadURL', 'application/octet-stream' + ':' + lName + ':' + lLink);