Fix bug 77529

This commit is contained in:
nikita_bartoshuk
2025-11-20 03:42:02 +03:00
parent a45d354d09
commit 47eff2849a
4 changed files with 30 additions and 5 deletions

View File

@ -76,6 +76,7 @@ define([
this.options.tpl = _.template(this.template)(this.options);
this.iconType = this.options.iconType;
this.mode = options.editMode;
Common.UI.Window.prototype.initialize.call(this, this.options);
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
@ -169,8 +170,8 @@ define([
this.updateResultsNumber(resultNumber, allResults);
}, this));
this.btnOpenPanelRedact && this.btnOpenPanelRedact.setVisible(this.mode === 'edit')
this.btnOpenPanelRedact && this.btnOpenPanelRedact.setVisible(this.mode === true);
this.btnOpenPanel && this.btnOpenPanel.setVisible(this.mode === false);
return this;
},

View File

@ -53,6 +53,14 @@ define([
sdkViewName : '#id_main',
initialize: function () {
this.addListeners({
'Common.Views.SearchPanel': {
'search:showredact': _.bind(this.onToggleFindRedact, this, 'show')
},
'SearchBar': {
'search:showredact': _.bind(this.onToggleFindRedact, this, 'show')
}
});
},
onLaunch: function () {
@ -62,12 +70,21 @@ define([
this.isFileMenuTab = null;
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
Common.NotificationCenter.on('leftmenu:change', _.bind(this.onToggleFindRedact, this));
this.binding = {
};
},
onToggleFindRedact: function (action) {
if (action === 'hide') {
this.view.btnFindRedact.toggle(false);
} else {
this.view.btnFindRedact.toggle(true);
}
},
setApi: function (api) {
if (api) {
this.api = api;

View File

@ -298,8 +298,10 @@ define([
(!Common.UI.LayoutManager.isElementVisible('leftMenu') || this.mode.customization && this.mode.customization.leftMenu === false);
this.searchBar = new Common.UI.SearchBar( hideLeftPanel ? {
showOpenPanel: false,
width: 303
} : {});
width: 303,
} : {
editMode: this.mode.isPDFEdit
});
this.searchBar.on('hide', _.bind(function () {
this.header.btnSearch.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete');

View File

@ -110,6 +110,7 @@ define([
iconCls: 'toolbar__icon btn-find-to-redact',
lock: [_set.lostConnect, _set.disableOnStart],
caption: me.capFindRedact,
enableToggle: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small',
@ -197,7 +198,11 @@ define([
},
onOpenPanel: function () {
this.fireEvent('search:showredact', [true, '']);
if (this.btnFindRedact.pressed === false) {
Common.NotificationCenter.trigger('leftmenu:change', 'hide');
} else {
this.fireEvent('search:showredact', [true, '']);
}
},
}
}()), PDFE.Views.RedactTab || {}));