Refactoring

This commit is contained in:
Julia.Radzhabova
2025-10-09 14:17:49 +03:00
parent 2372d1dbe4
commit 16885f4fcb

View File

@ -58,7 +58,7 @@ define([
onLaunch: function () { onLaunch: function () {
this._state = {}; this._state = {};
this.redactionsWarningVisible = null; this.redactionsWarning = null;
this.isFileMenuTab = null; this.isFileMenuTab = null;
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this)); Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
@ -194,9 +194,9 @@ define([
const isMarked = this.api.HasRedact(); const isMarked = this.api.HasRedact();
if ( if (
isMarked && isMarked &&
(!this.redactionsWarningVisible || !this.redactionsWarningVisible.isVisible()) (!this.redactionsWarning || !this.redactionsWarning.isVisible())
) { ) {
this.redactionsWarningVisible = Common.UI.warning({ this.redactionsWarning = Common.UI.warning({
width: 500, width: 500,
msg: this.textUnappliedRedactions, msg: this.textUnappliedRedactions,
buttons: [{ buttons: [{
@ -216,7 +216,7 @@ define([
this.api.RemoveAllRedact(); this.api.RemoveAllRedact();
this.api.SetRedactTool(false); this.api.SetRedactTool(false);
this.view.btnMarkForRedact.toggle(false); this.view.btnMarkForRedact.toggle(false);
} else if (btn == 'cancel') { } else {
if (this.isFileMenuTab) { if (this.isFileMenuTab) {
this.view.fireEvent('menu:hide', [this]); this.view.fireEvent('menu:hide', [this]);
} }
@ -233,7 +233,7 @@ define([
this.api.SetRedactTool(false); this.api.SetRedactTool(false);
} }
} }
this.isFileMenuTab = tab === 'file' ? true : false; this.isFileMenuTab = tab === 'file';
}, },
onRedactionStateToggle: function(isRedaction) { onRedactionStateToggle: function(isRedaction) {