From 8dcaaa0e5a9ec83c31237b50df47e711e2291c8b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 13 Sep 2023 13:11:40 +0300 Subject: [PATCH] Fix merge --- apps/pdfeditor/main/app/controller/DocumentHolder.js | 2 +- apps/pdfeditor/main/app/controller/LeftMenu.js | 5 +++++ apps/pdfeditor/main/app/controller/Main.js | 1 + apps/pdfeditor/main/app/controller/Statusbar.js | 8 ++++---- apps/pdfeditor/main/app/view/FileMenuPanels.js | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/pdfeditor/main/app/controller/DocumentHolder.js b/apps/pdfeditor/main/app/controller/DocumentHolder.js index 2496090bd1..b5bbc97a6c 100644 --- a/apps/pdfeditor/main/app/controller/DocumentHolder.js +++ b/apps/pdfeditor/main/app/controller/DocumentHolder.js @@ -319,7 +319,7 @@ define([ event.preventDefault(); event.stopPropagation(); return false; - } else if (key === 48 || key === 96) {// 0 + } else if (key === Common.UI.Keys.ZERO || key === Common.UI.Keys.NUM_ZERO) {// 0 me.api.zoom(100); event.preventDefault(); event.stopPropagation(); diff --git a/apps/pdfeditor/main/app/controller/LeftMenu.js b/apps/pdfeditor/main/app/controller/LeftMenu.js index 4dc1110286..41370e3df3 100644 --- a/apps/pdfeditor/main/app/controller/LeftMenu.js +++ b/apps/pdfeditor/main/app/controller/LeftMenu.js @@ -62,6 +62,11 @@ define([ 'Common.Views.Chat': { 'hide': _.bind(this.onHideChat, this) }, + 'Common.Views.Header': { + 'rename': _.bind(function (value) { + this.mode && this.mode.wopi && this.api ? this.api.asc_wopi_renameFile(value) : Common.Gateway.requestRename(value); + }, this) + }, 'Common.Views.About': { 'show': _.bind(this.aboutShowHide, this, false), 'hide': _.bind(this.aboutShowHide, this, true) diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index 43c5a14720..7b7b44f0b1 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -411,6 +411,7 @@ define([ Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch); this.appOptions.wopi = this.editorConfig.wopi; + appHeader.setWopi(this.appOptions.wopi); Common.Controllers.Desktop.init(this.appOptions); Common.UI.HintManager.setMode(this.appOptions); diff --git a/apps/pdfeditor/main/app/controller/Statusbar.js b/apps/pdfeditor/main/app/controller/Statusbar.js index 7f07f5cc5a..161ac27ee3 100644 --- a/apps/pdfeditor/main/app/controller/Statusbar.js +++ b/apps/pdfeditor/main/app/controller/Statusbar.js @@ -100,7 +100,7 @@ define([ onAppReady: function (config) { var me = this; - + me._isDocReady = true; (new Promise(function(resolve) { resolve(); })).then(function () { @@ -166,12 +166,12 @@ define([ * api events * */ - _onZoomChange: function(percent, type) { + _onZoomChange: function(percent, type) { this.statusbar.btnZoomToPage.toggle(type == 2, true); this.statusbar.btnZoomToWidth.toggle(type == 1, true); - $('.statusbar #label-zoom').text(Common.Utils.String.format(this.zoomText, percent)); - Common.localStorage.setItem('pdfe-last-zoom', percent); + if(!this._isDocReady) return; + Common.localStorage.setItem('pdfe-last-zoom', percent); }, setStatusCaption: function(text, force, delay, callback) { diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index 4b9752f6f2..ccda511d4a 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -375,7 +375,7 @@ define([ '', '