From f66789f97376cbd9548559e34906850622ed8eb3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 27 Feb 2024 15:45:38 +0300 Subject: [PATCH] [PE] Hide dialog for renaming anonymous when start slide show --- .../main/app/controller/Main.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index a0b0366886..2262d6a911 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -209,6 +209,8 @@ define([ this.api.asc_registerCallback('asc_onMeta', _.bind(this.onMeta, this)); this.api.asc_registerCallback('asc_onAdvancedOptions', _.bind(this.onAdvancedOptions, this)); this.api.asc_registerCallback('asc_onSpellCheckInit', _.bind(this.loadLanguages, this)); + Common.NotificationCenter.on('preview:start', _.bind(this.onPreviewStart, this)); + this.api.asc_registerCallback('asc_onEndDemonstration', _.bind(this.onEndDemonstration, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); Common.NotificationCenter.on('close', _.bind(this.closeEditor, this)); @@ -2609,6 +2611,7 @@ define([ me._renameDialog = undefined; }); this._renameDialog.show(Common.Utils.innerWidth() - this._renameDialog.options.width - 15, 30); + this._state.previewStarted && this._renameDialog.hide(); }, onLanguageLoaded: function() { @@ -2833,6 +2836,18 @@ define([ } }, + onPreviewStart: function() { + this._state.previewStarted = true; + if (this._renameDialog && this._renameDialog.isVisible()) + this._renameDialog.hide(); + }, + + onEndDemonstration: function() { + this._state.previewStarted = false; + if (this._renameDialog && !this._renameDialog.isVisible()) + this._renameDialog.show(); + }, + // Translation leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.', criticalErrorTitle: 'Error',