diff --git a/apps/common/main/lib/controller/LaunchController.js b/apps/common/main/lib/controller/LaunchController.js index 05dc22e00f..d39ea65da8 100644 --- a/apps/common/main/lib/controller/LaunchController.js +++ b/apps/common/main/lib/controller/LaunchController.js @@ -40,6 +40,7 @@ define([ this.api = api; Common.NotificationCenter.on('app:ready', on_app_ready.bind(this)); Common.NotificationCenter.on('app:face', on_hide_loader.bind(this)); + Common.NotificationCenter.on('app-pack:loaded', on_app_pack_loaded.bind(this)); } const load_scripts = function () { @@ -53,14 +54,19 @@ define([ if (!!Common.UI.ScreenReaderFocusManager) { Common.UI.ScreenReaderFocusManager.init(me.api); } - _all_scripts_loaded = true; if ( !!window.less ) { // detect development mode + _all_scripts_loaded = true; Common.NotificationCenter.trigger('script:loaded'); } }); } + const on_app_pack_loaded = function (config) { + _all_scripts_loaded = true; + Common.NotificationCenter.trigger('script:loaded'); + } + const on_app_ready = function (config) { load_scripts.call(this); } diff --git a/apps/common/main/lib/template/Header.template b/apps/common/main/lib/template/Header.template deleted file mode 100644 index a23dc0dddc..0000000000 --- a/apps/common/main/lib/template/Header.template +++ /dev/null @@ -1,6 +0,0 @@ -
- -
<%= headerCaption %>
-
<%= documentCaption %>
-
<%= textBack %>
-
\ No newline at end of file diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index ea49f375cf..a384ae3a92 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -43,9 +43,8 @@ Common.Views = Common.Views || {}; define([ 'backbone', - 'text!common/main/lib/template/Header.template', 'core' -], function (Backbone, headerTemplate) { 'use strict'; +], function (Backbone) { 'use strict'; Common.Views.Header = Backbone.View.extend(_.extend(function(){ var storeUsers, appConfig; @@ -758,9 +757,6 @@ define([ el: '#header', - // Compile our stats template - template: _.template(headerTemplate), - // Delegated events for creating new items, and clearing completed ones. events: { // 'click #header-logo': function (e) {} diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index a67edef75d..acb7444a26 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -713,7 +713,7 @@ border-top-width: @underscore_height; content: ''; position: absolute; - margin-left: 6px; + .margin-left-6(); width: calc(100% - 12px); bottom: -@underscore_height; opacity: 0; diff --git a/apps/documenteditor/forms/app_pack.js b/apps/documenteditor/forms/app_pack.js index 0d3c861062..a3e42c4138 100644 --- a/apps/documenteditor/forms/app_pack.js +++ b/apps/documenteditor/forms/app_pack.js @@ -7,5 +7,5 @@ require([ 'common/main/lib/view/SignDialog', 'common/main/lib/view/SignSettingsDialog', ], function () { - Common.NotificationCenter.trigger('script:loaded'); + Common.NotificationCenter.trigger('app-pack:loaded'); }); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 98fb3461f3..044a8f2406 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -66,8 +66,7 @@ define([ var mapCustomizationElements = { about: 'button#left-btn-about', - feedback: 'button#left-btn-support', - goback: '#fm-btn-back > a, #header-back > div' + feedback: 'button#left-btn-support' }; var mapCustomizationExtElements = { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 2cb6bbd606..6043874507 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2636,9 +2636,6 @@ define([ var parentOffset = Common.Utils.getOffset(this.toolbar.$el), top = e.clientY*Common.Utils.zoom(); - if ($('#header-container').is(":visible")) { - top -= $('#header-container').height() - } showPoint = [e.clientX*Common.Utils.zoom(), top - parentOffset.top]; if (record != undefined) { @@ -2707,9 +2704,6 @@ define([ onSaveStyle: function (style) { if (!window.styles_loaded) return; - window.styles_loaded = false; - this.toolbar.lockToolbar(Common.enumLock.noStyles, !window.styles_loaded, {array: [this.toolbar.listStyles]}); - var me = this, win; if (me.api) { @@ -2723,6 +2717,8 @@ define([ characterStyle.put_Name(title + '_character'); style.put_Next((nextStyle) ? nextStyle.asc_getName() : null); me.api.asc_AddNewStyle(style); + window.styles_loaded = false; + me.toolbar.lockToolbar(Common.enumLock.noStyles, !window.styles_loaded, {array: [me.toolbar.listStyles]}); } Common.NotificationCenter.trigger('edit:complete', me.toolbar); }; diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index b06c257c76..de2617b7fd 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -466,7 +466,7 @@ define([ if (!this.customizationDone) { this.customizationDone = true; - Common.Utils.applyCustomization(this.mode.customization, {goback: '#fm-btn-back > a'}); + this.mode.canBack && this.mode.customization.goback.text && typeof this.mode.customization.goback.text === 'string' && this.miBack.setCaption(this.mode.customization.goback.text); } this.panels['opts'].setMode(this.mode); diff --git a/apps/documenteditor/main/app_pack.js b/apps/documenteditor/main/app_pack.js index 7dfe624408..07fdee0b75 100644 --- a/apps/documenteditor/main/app_pack.js +++ b/apps/documenteditor/main/app_pack.js @@ -66,5 +66,5 @@ require([ 'documenteditor/main/app/view/ProtectDialog', 'documenteditor/main/app/view/MailMergeEmailDlg' ], function () { - Common.NotificationCenter.trigger('script:loaded'); + Common.NotificationCenter.trigger('app-pack:loaded'); }); diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index 234d428c3b..b8774b85f4 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -65,8 +65,7 @@ define([ var mapCustomizationElements = { about: 'button#left-btn-about', - feedback: 'button#left-btn-support', - goback: '#fm-btn-back > a, #header-back > div' + feedback: 'button#left-btn-support' }; var mapCustomizationExtElements = { diff --git a/apps/pdfeditor/main/app/view/FileMenu.js b/apps/pdfeditor/main/app/view/FileMenu.js index 146df6b32b..e64e1429cc 100644 --- a/apps/pdfeditor/main/app/view/FileMenu.js +++ b/apps/pdfeditor/main/app/view/FileMenu.js @@ -443,7 +443,7 @@ define([ if (!this.customizationDone) { this.customizationDone = true; - Common.Utils.applyCustomization(this.mode.customization, {goback: '#fm-btn-back > a'}); + this.mode.canBack && this.mode.customization.goback.text && typeof this.mode.customization.goback.text === 'string' && this.miBack.setCaption(this.mode.customization.goback.text); } this.panels['opts'].setMode(this.mode); diff --git a/apps/pdfeditor/main/app_pack.js b/apps/pdfeditor/main/app_pack.js index 1da5e1ed1f..6ba0889691 100644 --- a/apps/pdfeditor/main/app_pack.js +++ b/apps/pdfeditor/main/app_pack.js @@ -29,5 +29,5 @@ require([ 'pdfeditor/main/app/view/ShapeSettingsAdvanced', 'pdfeditor/main/app/view/TableSettingsAdvanced' ], function () { - Common.NotificationCenter.trigger('script:loaded'); + Common.NotificationCenter.trigger('app-pack:loaded'); }); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index e8ca4ba85a..1464196812 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -68,8 +68,7 @@ define([ var mapCustomizationElements = { about: 'button#left-btn-about', - feedback: 'button#left-btn-support', - goback: '#fm-btn-back > a, #header-back > div' + feedback: 'button#left-btn-support' }; var mapCustomizationExtElements = { diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 41c0b81956..37bd8ba4ec 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -460,7 +460,7 @@ define([ if (!this.customizationDone) { this.customizationDone = true; - Common.Utils.applyCustomization(this.mode.customization, {goback: '#fm-btn-back > a'}); + this.mode.canBack && this.mode.customization.goback.text && typeof this.mode.customization.goback.text === 'string' && this.miBack.setCaption(this.mode.customization.goback.text); } this.panels['opts'].setMode(this.mode); diff --git a/apps/presentationeditor/main/app_pack.js b/apps/presentationeditor/main/app_pack.js index 22fcbeece5..53a249ef6d 100644 --- a/apps/presentationeditor/main/app_pack.js +++ b/apps/presentationeditor/main/app_pack.js @@ -40,5 +40,5 @@ require([ 'presentationeditor/main/app/view/DateTimeDialog', 'presentationeditor/main/app/view/ChartSettingsAdvanced' ], function () { - Common.NotificationCenter.trigger('script:loaded'); + Common.NotificationCenter.trigger('app-pack:loaded'); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 33147c1538..aff82fcdbc 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -2061,9 +2061,9 @@ define([ showPoint = [data.asc_getX() + pos[0] - 10, data.asc_getY() + pos[1] + 20]; - var tipheight = filterTip.ref.getBSTip().$tip.width(); - if (showPoint[1] + filterTip.ttHeight > me.tooltips.coauth.bodyHeight ) { - showPoint[1] = me.tooltips.coauth.bodyHeight - filterTip.ttHeight - 5; + var tipheight = filterTip.ref.getBSTip().$tip.height(); + if (showPoint[1] + tipheight > me.tooltips.coauth.bodyHeight ) { + showPoint[1] = me.tooltips.coauth.bodyHeight - tipheight - 5; showPoint[0] += 20; } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index f48c295185..0fcad05b8a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -71,8 +71,7 @@ define([ var mapCustomizationElements = { about: 'button#left-btn-about', - feedback: 'button#left-btn-support', - goback: '#fm-btn-back > a, #header-back > div' + feedback: 'button#left-btn-support' }; var mapCustomizationExtElements = { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index e6c05d5dcc..319bdbfb00 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -442,7 +442,7 @@ define([ if (!this.customizationDone) { this.customizationDone = true; - Common.Utils.applyCustomization(this.mode.customization, {goback: '#fm-btn-back > a'}); + this.mode.canBack && this.mode.customization.goback.text && typeof this.mode.customization.goback.text === 'string' && this.miBack.setCaption(this.mode.customization.goback.text); } this.panels['opts'].setMode(this.mode); diff --git a/apps/spreadsheeteditor/main/app_pack.js b/apps/spreadsheeteditor/main/app_pack.js index fab57163a2..0088e2a527 100644 --- a/apps/spreadsheeteditor/main/app_pack.js +++ b/apps/spreadsheeteditor/main/app_pack.js @@ -85,5 +85,5 @@ require([ 'spreadsheeteditor/main/app/view/AutoFilterDialog', 'spreadsheeteditor/main/app/view/PivotGroupDialog', ], function () { - Common.NotificationCenter.trigger('script:loaded'); + Common.NotificationCenter.trigger('app-pack:loaded'); });