Fix "Download as ..." for wrong filenames

ccu#1367 - "Download as" links in File menu are downloading files
with a different filename like "ccs-fileID.ext".
This commit is contained in:
Faruk Uzun 2016-01-12 00:41:18 +02:00
parent deb080305c
commit 2e6aef6e9b

View File

@ -194,6 +194,16 @@ var documentsMain = {
iframe.find('#tb_toolbar-up_item_close').click(function() { iframe.find('#tb_toolbar-up_item_close').click(function() {
documentsMain.onClose(); documentsMain.onClose();
}); });
var frameWindow = $('#loleafletframe')[0].contentWindow;
(function() {
cloudSuiteOnClick = frameWindow.onClick;
frameWindow.onClick = function() {
fileName = encodeURIComponent(title.substr(0, title.lastIndexOf('.')) || title);
frameWindow.map.options.doc = fileName;
cloudSuiteOnClick.apply(this, arguments);
frameWindow.map.options.doc = documentsMain.url;
};
})();
}); });
}, },