[DE] Fix highlighting of search results
This commit is contained in:
parent
c10d349a19
commit
1ed6a7b830
|
@ -131,6 +131,7 @@ define([
|
|||
|
||||
if (text) {
|
||||
this.inputSearch.val(text);
|
||||
this.fireEvent('search:input', [text]);
|
||||
} else {
|
||||
this.inputSearch.val('');
|
||||
}
|
||||
|
@ -149,6 +150,7 @@ define([
|
|||
|
||||
setText: function (text) {
|
||||
this.inputSearch.val(text);
|
||||
this.fireEvent('search:input', [text]);
|
||||
},
|
||||
|
||||
getSettings: function() {
|
||||
|
|
|
@ -806,12 +806,13 @@ define([
|
|||
this.leftMenu.fireEvent('search:aftershow', this.leftMenu, selectedText);
|
||||
return false;
|
||||
} else if (this.getApplication().getController('Viewport').isSearchBarVisible()) {
|
||||
var viewport = this.getApplication().getController('Viewport');
|
||||
if (s === 'replace') {
|
||||
this.getApplication().getController('Viewport').header.btnSearch.toggle(false);
|
||||
this.onShowHideSearch(true, this.getApplication().getController('Viewport').searchBar.inputSearch.val());
|
||||
viewport.header.btnSearch.toggle(false);
|
||||
this.onShowHideSearch(true, viewport.searchBar.inputSearch.val());
|
||||
} else {
|
||||
selectedText && this.getApplication().getController('Viewport').searchBar.setText(selectedText);
|
||||
this.getApplication().getController('Viewport').searchBar.focus();
|
||||
selectedText && viewport.searchBar.setText(selectedText);
|
||||
viewport.searchBar.focus();
|
||||
return false;
|
||||
}
|
||||
} else if (s === 'search') {
|
||||
|
|
|
@ -58,7 +58,9 @@ define([
|
|||
'search:back': _.bind(this.onSearchNext, this, 'back'),
|
||||
'search:next': _.bind(this.onSearchNext, this, 'next'),
|
||||
'search:input': _.bind(this.onInputSearchChange, this),
|
||||
'search:keydown': _.bind(this.onSearchNext, this, 'keydown')
|
||||
'search:keydown': _.bind(this.onSearchNext, this, 'keydown'),
|
||||
'show': _.bind(this.onSelectSearchingResults, this, true),
|
||||
'hide': _.bind(this.onSelectSearchingResults, this, false)
|
||||
},
|
||||
'Common.Views.SearchPanel': {
|
||||
'search:back': _.bind(this.onSearchNext, this, 'back'),
|
||||
|
@ -81,7 +83,8 @@ define([
|
|||
searchText: '',
|
||||
matchCase: false,
|
||||
matchWord: false,
|
||||
useRegExp: false
|
||||
useRegExp: false,
|
||||
isHighlightedResults: false
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -329,6 +332,7 @@ define([
|
|||
},
|
||||
|
||||
onShowPanel: function () {
|
||||
this.onSelectSearchingResults(true);
|
||||
if (this.resultItems && this.resultItems.length > 0 && !this._state.isStartedAddingResults) {
|
||||
var me = this;
|
||||
this.view.$resultsContainer.show();
|
||||
|
@ -345,6 +349,16 @@ define([
|
|||
|
||||
onHidePanel: function () {
|
||||
this.hideResults();
|
||||
this.onSelectSearchingResults(false);
|
||||
},
|
||||
|
||||
onSelectSearchingResults: function (val) {
|
||||
if (!val && this.getApplication().getController('LeftMenu').isSearchPanelVisible()) return;
|
||||
|
||||
if (this._state.isHighlightedResults !== val) {
|
||||
this.api.asc_selectSearchingResults(val);
|
||||
this._state.isHighlightedResults = val;
|
||||
}
|
||||
},
|
||||
|
||||
notcriticalErrorTitle: 'Warning',
|
||||
|
|
Loading…
Reference in a new issue