summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2016-11-15 13:58:25 +0530
committerPranav Kant <pranavk@collabora.co.uk>2016-11-15 18:23:42 +0530
commit26adebfcb06521bb7023f22ada041298c3c4aa3d (patch)
treef2a335f88c3d186993c6d46ac64651987c81693f
parentd8a202bf1cc2a4cc343833348f08dcfdadbdd409 (diff)
tdf#103641: Fix save button visible for presentation
Additionally, change the variable name for presentation-toolbar to avoid any future confusion. Also, put the code hiding the save button in onRefresh event so that save button doesn't show up in the UI as soon as we get the wopi properties object from the server. Change-Id: Ib168010c509f55a69aae9752e11321d319f59e99
-rw-r--r--loleaflet/dist/toolbar/toolbar.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 0bb3eee23..8ce0d9a0e 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -732,6 +732,12 @@ function onFormulaBarBlur() {
}, 250);
}
+map.on('wopiprops', function(e) {
+ if (e.HideSaveOption) {
+ w2ui['toolbar-up'].hide('save');
+ }
+});
+
map.on('doclayerinit', function () {
var toolbar = w2ui['toolbar-up'];
var docType = map.getDocType();
@@ -739,12 +745,12 @@ map.on('doclayerinit', function () {
if (docType === 'presentation') {
toolbar.hide('annotation');
- toolbar = w2ui['presentation-toolbar'];
- toolbar.show('presentation');
- toolbar.show('presentationbreak');
- toolbar.show('insertpage');
- toolbar.show('duplicatepage');
- toolbar.show('deletepage');
+ var presentationToolbar = w2ui['presentation-toolbar'];
+ presentationToolbar.show('presentation');
+ presentationToolbar.show('presentationbreak');
+ presentationToolbar.show('insertpage');
+ presentationToolbar.show('duplicatepage');
+ presentationToolbar.show('deletepage');
}
else if (docType === 'drawing') {
toolbar.hide('annotation');
@@ -757,10 +763,6 @@ map.on('doclayerinit', function () {
}
}
- if (map['wopi'].HideSaveOption) {
- toolbar.hide('save');
- }
-
var statusbar = w2ui['toolbar-down'];
switch (docType) {
case 'spreadsheet':