From 2e6aef6e9b284b753bfd5bf95d5a23bf0863f756 Mon Sep 17 00:00:00 2001 From: Faruk Uzun Date: Tue, 12 Jan 2016 00:41:18 +0200 Subject: [PATCH] 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". --- js/documents.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/documents.js b/js/documents.js index af7c6e8e..f8058c81 100644 --- a/js/documents.js +++ b/js/documents.js @@ -194,6 +194,16 @@ var documentsMain = { iframe.find('#tb_toolbar-up_item_close').click(function() { 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; + }; + })(); }); },