From 648abe2198d5e80f42d91e4f712930d6419827eb Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 9 Apr 2018 14:23:44 +0300 Subject: [PATCH] [PE] FIx Bug 21362 --- apps/common/main/lib/component/DataView.js | 12 ++++++----- .../main/app/controller/Main.js | 20 ++++++++++++++++++- .../main/app/controller/Toolbar.js | 7 +++++-- .../main/app/view/Toolbar.js | 1 - apps/presentationeditor/main/locale/en.json | 11 ++++++++++ 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index 210e829ab..07b629f58 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -278,6 +278,13 @@ define([ })); } + var modalParents = this.cmpEl.closest('.asc-window'); + if (modalParents.length < 1) + modalParents = this.cmpEl.closest('[id^="menu-container-"]'); // context menu + if (modalParents.length > 0) { + this.tipZIndex = parseInt(modalParents.css('z-index')) + 10; + } + if (!this.rendered) { if (this.listenStoreEvents) { this.listenTo(this.store, 'add', this.onAddItem); @@ -316,11 +323,6 @@ define([ }); } - var modalParents = this.cmpEl.closest('.asc-window'); - if (modalParents.length > 0) { - this.tipZIndex = parseInt(modalParents.css('z-index')) + 10; - } - this.rendered = true; this.cmpEl.on('click', function(e){ diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 44b41af4a..5aef5119d 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -104,6 +104,7 @@ define([ this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false}; this.languages = null; + this.translationTable = []; window.storagename = 'presentation'; @@ -123,6 +124,7 @@ define([ // Initialize api window["flat_desine"] = true; + this.api = new Asc.asc_docs_api({ 'id-view' : 'editor_sdk', 'translate': { @@ -151,6 +153,11 @@ define([ } }); + var themeNames = ['blank', 'pixel', 'classic', 'official', 'green', 'lines', 'office', 'safari', 'dotted', 'corner', 'turtle']; + themeNames.forEach(function(item){ + me.translationTable[item] = me['txtTheme_' + item.replace(/ /g, '_')] || item; + }); + if (this.api){ this.api.SetDrawingFreeze(true); this.api.SetThemesPath("../../../../sdkjs/slide/themes/"); @@ -2001,7 +2008,18 @@ define([ txtAddNotes: 'Click to add notes', warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.', errorForceSave: "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", - txtAddFirstSlide: 'Click to add first slide' + txtAddFirstSlide: 'Click to add first slide', + txtTheme_blank: 'Blank', + txtTheme_pixel: 'Pixel', + txtTheme_classic: 'Classic', + txtTheme_official: 'Official', + txtTheme_green: 'Green', + txtTheme_lines: 'Lines', + txtTheme_office: 'Office', + txtTheme_safari: 'Safari', + txtTheme_dotted: 'Dotted', + txtTheme_corner: 'Corner', + txtTheme_turtle: 'Turtle' } })(), PE.Controllers.Main || {})) }); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index da523a4e6..0d978a2f5 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1881,7 +1881,8 @@ define([ me.toolbar.listTheme.menuPicker.store.reset([]); // remove all - var themeStore = this.getCollection('SlideThemes'); + var themeStore = this.getCollection('SlideThemes'), + mainController = this.getApplication().getController('Main'); if (themeStore) { var arr = []; _.each(defaultThemes.concat(docThemes), function(theme) { @@ -1889,13 +1890,15 @@ define([ imageUrl: theme.get_Image(), uid : Common.UI.getId(), themeId : theme.get_Index(), + tip : mainController.translationTable[theme.get_Name()] || theme.get_Name(), itemWidth : 85, itemHeight : 38 })); me.toolbar.listTheme.menuPicker.store.add({ imageUrl: theme.get_Image(), uid : Common.UI.getId(), - themeId : theme.get_Index() + themeId : theme.get_Index(), + tip : mainController.translationTable[theme.get_Name()] || theme.get_Name() }); }); themeStore.reset(arr); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index d65c85791..0faefcde3 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -707,7 +707,6 @@ define([ itemWidth : 85, enableKeyEvents: true, itemHeight : 38, - hint: this.tipSlideTheme, lock: [_set.themeLock, _set.lostConnect, _set.noSlides], beforeOpenHandler: function(e) { var cmp = this, diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 23227e68e..f5726569e 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -360,6 +360,17 @@ "PE.Controllers.Main.txtStarsRibbons": "Stars & Ribbons", "PE.Controllers.Main.txtXAxis": "X Axis", "PE.Controllers.Main.txtYAxis": "Y Axis", + "PE.Controllers.Main.txtTheme_blank": "Blank", + "PE.Controllers.Main.txtTheme_pixel": "Pixel", + "PE.Controllers.Main.txtTheme_classic": "Classic", + "PE.Controllers.Main.txtTheme_official": "Official", + "PE.Controllers.Main.txtTheme_green": "Green", + "PE.Controllers.Main.txtTheme_lines": "Lines", + "PE.Controllers.Main.txtTheme_office": "Office", + "PE.Controllers.Main.txtTheme_safari": "Safari", + "PE.Controllers.Main.txtTheme_dotted": "Dotted", + "PE.Controllers.Main.txtTheme_corner": "Corner", + "PE.Controllers.Main.txtTheme_turtle": "Turtle", "PE.Controllers.Main.unknownErrorText": "Unknown error.", "PE.Controllers.Main.unsupportedBrowserErrorText": "Your browser is not supported.", "PE.Controllers.Main.uploadImageExtMessage": "Unknown image format.",