diff --git a/apps/pdfeditor/main/app/controller/LeftMenu.js b/apps/pdfeditor/main/app/controller/LeftMenu.js index 0f6701c9e3..94648dd832 100644 --- a/apps/pdfeditor/main/app/controller/LeftMenu.js +++ b/apps/pdfeditor/main/app/controller/LeftMenu.js @@ -113,7 +113,8 @@ define([ 'search:showredact': _.bind(this.onShowHideRedactSearch, this) }, 'RedactTab': { - 'search:showredact': _.bind(this.onShowHideRedactSearch, this) + 'search:showredact': _.bind(this.onShowHideRedactSearch, this), + 'menu:hide': _.bind(this.clickToolbarTab, this, 'red') }, 'Common.Views.SearchPanel': { 'search:showredact': _.bind(this.onShowHideRedactSearch, this) diff --git a/apps/pdfeditor/main/app/controller/RedactTab.js b/apps/pdfeditor/main/app/controller/RedactTab.js index 4f47e37294..9bf61db54f 100644 --- a/apps/pdfeditor/main/app/controller/RedactTab.js +++ b/apps/pdfeditor/main/app/controller/RedactTab.js @@ -58,6 +58,8 @@ define([ onLaunch: function () { this._state = {}; + this.redactionsWarning = null; + this.isFileMenuTab = null; Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this)); @@ -190,8 +192,11 @@ define([ Common.UI.TooltipManager.closeTip('mark-for-redaction'); Common.UI.TooltipManager.closeTip('apply-redaction'); const isMarked = this.api.HasRedact(); - if (isMarked) { - Common.UI.warning({ + if ( + isMarked && + (!this.redactionsWarning || !this.redactionsWarning.isVisible()) + ) { + this.redactionsWarning = Common.UI.warning({ width: 500, msg: this.textUnappliedRedactions, buttons: [{ @@ -211,7 +216,10 @@ define([ this.api.RemoveAllRedact(); this.api.SetRedactTool(false); this.view.btnMarkForRedact.toggle(false); - } else if (btn == 'cancel') { + } else { + if (this.isFileMenuTab) { + this.view.fireEvent('menu:hide', [this]); + } if (this.mode.isPDFEdit) { this.toolbar.toolbar.setTab('red') } else { @@ -225,6 +233,7 @@ define([ this.api.SetRedactTool(false); } } + this.isFileMenuTab = tab === 'file'; }, onRedactionStateToggle: function(isRedaction) {