[DE PE SSE] New search: add filling find input, fix view mode

This commit is contained in:
JuliaSvinareva 2022-03-02 21:48:37 +03:00
parent 2ac854edc4
commit 2bfe6b2d2c
8 changed files with 16 additions and 8 deletions

View file

@ -118,9 +118,10 @@ define([
show: function() {
var top = $('#app-title').height() + $('#toolbar').height() + 2,
left = Common.Utils.innerWidth() - $('#right-menu').width() - this.options.width - 32;
left = Common.Utils.innerWidth() - ($('#right-menu').is(':visible') ? $('#right-menu').width() : 0) - this.options.width - 32;
Common.UI.Window.prototype.show.call(this, left, top);
this.inputSearch.val('');
this.focus();
},
@ -154,7 +155,7 @@ define([
onOpenPanel: function () {
this.hide();
this.fireEvent('search:show', [true]);
this.fireEvent('search:show', [true, this.inputSearch.val()]);
},
textFind: 'Find'

View file

@ -271,6 +271,10 @@ define([
Common.localStorage.setBool('sse-search-options-extended', this.extendedOptions);
},
setFindText: function (val) {
this.inputText.setValue(val);
},
textFind: 'Find',
textFindAndReplace: 'Find and replace',
textCloseSearch: 'Close search',

View file

@ -921,10 +921,11 @@ define([
}
},
onShowHideSearch: function (state, action) {
onShowHideSearch: function (state, findText, action) {
if (state) {
Common.UI.Menu.Manager.hideAll();
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
findText && this.leftMenu.panelSearch.setFindText(findText);
this.leftMenu.panelSearch.setSearchMode(mode);
this.leftMenu.showMenu('advancedsearch');
} else {

View file

@ -333,13 +333,13 @@ define([
cls : 'btn-toolbar'
})).on('click', _on_btn_zoom.bind(me, 'up'));
me.header.btnSearch.on('click', me.onSearchClick.bind(this));
me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this));
if ( !Common.UI.Themes.isDarkTheme() ) {
me.header.menuItemsDarkMode.hide();
me.header.menuItemsDarkMode.$el.prev('.divider').hide();
}
}
me.header.btnSearch.on('click', me.onSearchClick.bind(this));
},
onLayoutChanged: function(area) {

View file

@ -774,10 +774,11 @@ define([
}
},
onShowHideSearch: function (state, action) {
onShowHideSearch: function (state, findText, action) {
if (state) {
Common.UI.Menu.Manager.hideAll();
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
findText && this.leftMenu.panelSearch.setFindText(findText);
this.leftMenu.panelSearch.setSearchMode(mode);
this.leftMenu.showMenu('advancedsearch');
} else {

View file

@ -342,8 +342,8 @@ define([
})).on('click', _on_btn_zoom.bind(me, 'up'));
me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this));
me.header.btnSearch.on('click', me.onSearchClick.bind(this));
}
me.header.btnSearch.on('click', me.onSearchClick.bind(this));
},
onLayoutChanged: function(area) {

View file

@ -983,10 +983,11 @@ define([
}
},
onShowHideSearch: function (state, action) {
onShowHideSearch: function (state, findText, action) {
if (state) {
Common.UI.Menu.Manager.hideAll();
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
findText && this.leftMenu.panelSearch.setFindText(findText);
this.leftMenu.panelSearch.setSearchMode(mode);
this.leftMenu.showMenu('advancedsearch');
} else {

View file

@ -348,8 +348,8 @@ define([
})).on('click', _on_btn_zoom.bind(me, 'up'));
me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this));
me.header.btnSearch.on('click', me.onSearchClick.bind(this));
}
me.header.btnSearch.on('click', me.onSearchClick.bind(this));
},
// When our application is ready, lets get started