mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
fixed menu file hiding
This commit is contained in:
@ -113,7 +113,8 @@ define([
|
|||||||
'search:showredact': _.bind(this.onShowHideRedactSearch, this)
|
'search:showredact': _.bind(this.onShowHideRedactSearch, this)
|
||||||
},
|
},
|
||||||
'RedactTab': {
|
'RedactTab': {
|
||||||
'search:showredact': _.bind(this.onShowHideRedactSearch, this)
|
'search:showredact': _.bind(this.onShowHideRedactSearch, this),
|
||||||
|
'menu:hide': _.bind(this.clickToolbarTab, this, 'red')
|
||||||
},
|
},
|
||||||
'Common.Views.SearchPanel': {
|
'Common.Views.SearchPanel': {
|
||||||
'search:showredact': _.bind(this.onShowHideRedactSearch, this)
|
'search:showredact': _.bind(this.onShowHideRedactSearch, this)
|
||||||
|
|||||||
@ -59,6 +59,7 @@ define([
|
|||||||
this._state = {};
|
this._state = {};
|
||||||
|
|
||||||
this.redactionsWarningVisible = null;
|
this.redactionsWarningVisible = 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));
|
||||||
|
|
||||||
@ -191,9 +192,11 @@ define([
|
|||||||
Common.UI.TooltipManager.closeTip('mark-for-redaction');
|
Common.UI.TooltipManager.closeTip('mark-for-redaction');
|
||||||
Common.UI.TooltipManager.closeTip('apply-redaction');
|
Common.UI.TooltipManager.closeTip('apply-redaction');
|
||||||
const isMarked = this.api.HasRedact();
|
const isMarked = this.api.HasRedact();
|
||||||
if (isMarked && !this.redactionsWarningVisible) {
|
if (
|
||||||
this.redactionsWarningVisible = true;
|
isMarked &&
|
||||||
Common.UI.warning({
|
(!this.redactionsWarningVisible || !this.redactionsWarningVisible.isVisible())
|
||||||
|
) {
|
||||||
|
this.redactionsWarningVisible = Common.UI.warning({
|
||||||
width: 500,
|
width: 500,
|
||||||
msg: this.textUnappliedRedactions,
|
msg: this.textUnappliedRedactions,
|
||||||
buttons: [{
|
buttons: [{
|
||||||
@ -209,19 +212,19 @@ define([
|
|||||||
this.api.ApplyRedact();
|
this.api.ApplyRedact();
|
||||||
this.api.SetRedactTool(false);
|
this.api.SetRedactTool(false);
|
||||||
this.view.btnMarkForRedact.toggle(false);
|
this.view.btnMarkForRedact.toggle(false);
|
||||||
this.redactionsWarningVisible = false;
|
|
||||||
} else if (btn == 'doNotApply') {
|
} else if (btn == 'doNotApply') {
|
||||||
this.api.RemoveAllRedact();
|
this.api.RemoveAllRedact();
|
||||||
this.api.SetRedactTool(false);
|
this.api.SetRedactTool(false);
|
||||||
this.view.btnMarkForRedact.toggle(false);
|
this.view.btnMarkForRedact.toggle(false);
|
||||||
this.redactionsWarningVisible = false;
|
|
||||||
} else if (btn == 'cancel') {
|
} else if (btn == 'cancel') {
|
||||||
|
if (this.isFileMenuTab) {
|
||||||
|
this.view.fireEvent('menu:hide', [this]);
|
||||||
|
}
|
||||||
if (this.mode.isPDFEdit) {
|
if (this.mode.isPDFEdit) {
|
||||||
this.toolbar.toolbar.setTab('red')
|
this.toolbar.toolbar.setTab('red')
|
||||||
} else {
|
} else {
|
||||||
Common.NotificationCenter.trigger('pdf:mode-apply', 'edit', 'red');
|
Common.NotificationCenter.trigger('pdf:mode-apply', 'edit', 'red');
|
||||||
}
|
}
|
||||||
this.redactionsWarningVisible = false;
|
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
});
|
});
|
||||||
@ -230,6 +233,7 @@ define([
|
|||||||
this.api.SetRedactTool(false);
|
this.api.SetRedactTool(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.isFileMenuTab = tab === 'file' ? true : false;
|
||||||
},
|
},
|
||||||
|
|
||||||
onRedactionStateToggle: function(isRedaction) {
|
onRedactionStateToggle: function(isRedaction) {
|
||||||
|
|||||||
Reference in New Issue
Block a user