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