From 6f22f432456febe90cc7f77be568a8614595ebd5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 6 May 2022 11:33:48 +0300 Subject: [PATCH 1/3] Fix Bug 57038 --- .../main/app/controller/ViewTab.js | 52 +++++++++++-------- .../main/app/template/Toolbar.template | 2 +- .../main/app/controller/ViewTab.js | 44 +++++++++------- .../main/app/template/Toolbar.template | 2 +- .../main/app/view/ViewTab.js | 2 + .../main/app/controller/ViewTab.js | 6 ++- .../main/app/template/Toolbar.template | 2 +- .../main/app/view/ViewTab.js | 39 +++++++------- 8 files changed, 84 insertions(+), 65 deletions(-) diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index 6558e36aa..37bda77c5 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -79,6 +79,10 @@ define([ mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); + if (!Common.UI.Themes.available()) { + this.view.btnInterfaceTheme.$el.closest('.group').remove(); + this.view.cmpEl.find('.separator-theme').remove(); + } if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { this.view.chStatusbar.$el.remove(); var slotChkRulers = this.view.chRulers.$el, @@ -144,30 +148,32 @@ define([ me.view.turnNavigation(state); }); - var menuItems = [], - currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); - for (var t in Common.UI.Themes.map()) { - menuItems.push({ - value: t, - caption: Common.UI.Themes.get(t).text, - checked: t === currentTheme, - checkable: true, - toggleGroup: 'interface-theme' - }); - } + if (Common.UI.Themes.available()) { + var menuItems = [], + currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); + for (var t in Common.UI.Themes.map()) { + menuItems.push({ + value: t, + caption: Common.UI.Themes.get(t).text, + checked: t === currentTheme, + checkable: true, + toggleGroup: 'interface-theme' + }); + } - if (menuItems.length) { - me.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); - me.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { - var value = item.value; - Common.UI.Themes.setTheme(value); - me.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme()); - }, me)); + if (menuItems.length) { + me.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); + me.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { + var value = item.value; + Common.UI.Themes.setTheme(value); + me.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme()); + }, me)); - setTimeout(function () { - me.onContentThemeChangedToDark(Common.UI.Themes.isContentThemeDark()); - me.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme()); - }, 0); + setTimeout(function () { + me.onContentThemeChangedToDark(Common.UI.Themes.isContentThemeDark()); + me.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme()); + }, 0); + } } }); } @@ -243,7 +249,7 @@ define([ }, onThemeChanged: function () { - if (this.view) { + if (this.view && Common.UI.Themes.available()) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); if ( menu_item ) { diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template index 9c58b9340..61578885c 100644 --- a/apps/documenteditor/main/app/template/Toolbar.template +++ b/apps/documenteditor/main/app/template/Toolbar.template @@ -200,7 +200,7 @@ -
+
diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 23d85f9f4..c2ad754e9 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -81,6 +81,10 @@ define([ mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); + if (!Common.UI.Themes.available()) { + this.view.btnInterfaceTheme.$el.closest('.group').remove(); + this.view.cmpEl.find('.separator-theme').remove(); + } if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { this.view.chStatusbar.$el.remove(); } @@ -89,7 +93,7 @@ define([ 'zoom:toslide': _.bind(this.onBtnZoomTo, this, 'toslide'), 'zoom:towidth': _.bind(this.onBtnZoomTo, this, 'towidth'), 'rulers:change': _.bind(this.onChangeRulers, this), - 'notes:change': _.bind(this.onChangeNotes, this), + 'notes:change': _.bind(this.onChangeNotes, this) }, 'Toolbar': { 'view:compact': _.bind(function (toolbar, state) { @@ -150,24 +154,26 @@ define([ .on('combo:blur', _.bind(me.onComboBlur, me, false)); }); - var menuItems = [], - currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); - for (var t in Common.UI.Themes.map()) { - menuItems.push({ - value: t, - caption: Common.UI.Themes.get(t).text, - checked: t === currentTheme, - checkable: true, - toggleGroup: 'interface-theme' - }); - } + if (Common.UI.Themes.available()) { + var menuItems = [], + currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); + for (var t in Common.UI.Themes.map()) { + menuItems.push({ + value: t, + caption: Common.UI.Themes.get(t).text, + checked: t === currentTheme, + checkable: true, + toggleGroup: 'interface-theme' + }); + } - if (menuItems.length) { - this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); - this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { - var value = item.value; - Common.UI.Themes.setTheme(value); - }, this)); + if (menuItems.length) { + this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); + this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { + var value = item.value; + Common.UI.Themes.setTheme(value); + }, this)); + } } } }, @@ -199,7 +205,7 @@ define([ }, onThemeChanged: function () { - if (this.view) { + if (this.view && Common.UI.Themes.available()) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); if ( !!menu_item ) { diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index 300c2f067..213ef3af9 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -199,7 +199,7 @@
-
+
diff --git a/apps/presentationeditor/main/app/view/ViewTab.js b/apps/presentationeditor/main/app/view/ViewTab.js index f34bbe04b..a124e25d2 100644 --- a/apps/presentationeditor/main/app/view/ViewTab.js +++ b/apps/presentationeditor/main/app/view/ViewTab.js @@ -195,6 +195,8 @@ define([ dataHintOffset: 'small' }); this.lockedControls.push(this.chNotes); + + this.cmpEl = $host; }, render: function (el) { diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 8a09ef62b..26fa3903b 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -84,6 +84,10 @@ define([ mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); + if (!Common.UI.Themes.available()) { + this.view.btnInterfaceTheme.$el.closest('.group').remove(); + this.view.cmpEl.find('.separator-theme').remove(); + } if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { this.view.chStatusbar.$el.remove(); } @@ -281,7 +285,7 @@ define([ }, onThemeChanged: function () { - if (this.view) { + if (this.view && Common.UI.Themes.available()) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); if ( !!menu_item ) { diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index 8b8d43f99..0fcd08cdc 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -270,7 +270,7 @@
-
+
diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index e6ad3cd1b..4eccc9768 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -264,7 +264,7 @@ define([ this.lockedControls.push(this.chToolbar); $host.find('#slot-lbl-zoom').text(this.textZoom); - + this.cmpEl = $host; Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -312,26 +312,27 @@ define([ })); me.btnFreezePanes.updateHint(me.tipFreeze); - var menuItems = [], - currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); - for (var t in Common.UI.Themes.map()) { - menuItems.push({ - value: t, - caption: Common.UI.Themes.get(t).text, - checked: t === currentTheme, - checkable: true, - toggleGroup: 'interface-theme' - }); - } + if (Common.UI.Themes.available()) { + var menuItems = [], + currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); + for (var t in Common.UI.Themes.map()) { + menuItems.push({ + value: t, + caption: Common.UI.Themes.get(t).text, + checked: t === currentTheme, + checkable: true, + toggleGroup: 'interface-theme' + }); + } - if (menuItems.length) { - me.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); - me.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { - var value = item.value; - Common.UI.Themes.setTheme(value); - }, me)); + if (menuItems.length) { + me.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); + me.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { + var value = item.value; + Common.UI.Themes.setTheme(value); + }, me)); + } } - setEvents.call(me); }); }, From 78e0cbaad74173346e3aee0cce49a7c5d407ae29 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 6 May 2022 11:34:05 +0300 Subject: [PATCH 2/3] Fix styles for IE11 --- apps/presentationeditor/main/resources/less/leftmenu.less | 1 + apps/spreadsheeteditor/main/resources/less/leftmenu.less | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 7adf9ab21..a37b536eb 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -72,6 +72,7 @@ background-color: @highlight-button-pressed; > a { + color: @text-normal-pressed-ie; color: @text-normal-pressed; } } diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 67dafde38..316e10772 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -72,6 +72,7 @@ background-color: @highlight-button-pressed; > a { + color: @text-normal-pressed-ie; color: @text-normal-pressed; } } From 648f0bdec73153e365d45313b92977b7dd3ec439 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 6 May 2022 11:52:33 +0300 Subject: [PATCH 3/3] Fix for IE11 --- apps/documenteditor/main/index.html | 4 +++- apps/presentationeditor/main/index.html | 4 +++- apps/spreadsheeteditor/main/index.html | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html index f1157d4f0..c68fefd47 100644 --- a/apps/documenteditor/main/index.html +++ b/apps/documenteditor/main/index.html @@ -245,8 +245,10 @@ window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; - if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) + if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { document.write(' diff --git a/apps/presentationeditor/main/index.html b/apps/presentationeditor/main/index.html index c8b8c07bd..c008fa3ae 100644 --- a/apps/presentationeditor/main/index.html +++ b/apps/presentationeditor/main/index.html @@ -261,8 +261,10 @@ window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; - if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) + if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { document.write(' diff --git a/apps/spreadsheeteditor/main/index.html b/apps/spreadsheeteditor/main/index.html index 3adb261d6..b777d84c0 100644 --- a/apps/spreadsheeteditor/main/index.html +++ b/apps/spreadsheeteditor/main/index.html @@ -268,8 +268,10 @@ window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; - if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) + if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { document.write('