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 () {
this._state = {};
this.redactionsWarningVisible = null;
this.redactionsWarning = null;
this.isFileMenuTab = null;
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
@ -194,9 +194,9 @@ define([
const isMarked = this.api.HasRedact();
if (
isMarked &&
(!this.redactionsWarningVisible || !this.redactionsWarningVisible.isVisible())
(!this.redactionsWarning || !this.redactionsWarning.isVisible())
) {
this.redactionsWarningVisible = Common.UI.warning({
this.redactionsWarning = Common.UI.warning({
width: 500,
msg: this.textUnappliedRedactions,
buttons: [{
@ -216,7 +216,7 @@ 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]);
}
@ -233,7 +233,7 @@ define([
this.api.SetRedactTool(false);
}
}
this.isFileMenuTab = tab === 'file' ? true : false;
this.isFileMenuTab = tab === 'file';
},
onRedactionStateToggle: function(isRedaction) {