[DE PE SSE] Fix search
This commit is contained in:
parent
2db9b044c5
commit
c31017def8
|
@ -52,7 +52,8 @@ define([
|
||||||
header: false,
|
header: false,
|
||||||
cls: 'search-bar',
|
cls: 'search-bar',
|
||||||
alias: 'SearchBar',
|
alias: 'SearchBar',
|
||||||
showOpenPanel: true
|
showOpenPanel: true,
|
||||||
|
toolclose: 'hide'
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
|
|
|
@ -361,7 +361,7 @@ define([
|
||||||
|
|
||||||
var text = typeof findText === 'string' ? findText : (this.api.asc_GetSelectedText() || this._state.searchText);
|
var text = typeof findText === 'string' ? findText : (this.api.asc_GetSelectedText() || this._state.searchText);
|
||||||
if (this.resultItems && this.resultItems.length > 0 &&
|
if (this.resultItems && this.resultItems.length > 0 &&
|
||||||
(!this._state.matchCase && text.toLowerCase() === this.view.inputText.getValue().toLowerCase() ||
|
(!this._state.matchCase && text && text.toLowerCase() === this.view.inputText.getValue().toLowerCase() ||
|
||||||
this._state.matchCase && text === this.view.inputText.getValue())) { // show old results
|
this._state.matchCase && text === this.view.inputText.getValue())) { // show old results
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -373,10 +373,10 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.hideResults();
|
this.hideResults();
|
||||||
if (text !== '' && text === this._state.searchText) { // search was made
|
if (text && text !== '' && text === this._state.searchText) { // search was made
|
||||||
this.view.disableReplaceButtons(false);
|
this.view.disableReplaceButtons(false);
|
||||||
this.api.asc_StartTextAroundSearch();
|
this.api.asc_StartTextAroundSearch();
|
||||||
} else if (text !== '') { // search wasn't made
|
} else if (text && text !== '') { // search wasn't made
|
||||||
this.onInputSearchChange(text);
|
this.onInputSearchChange(text);
|
||||||
} else {
|
} else {
|
||||||
this.resultItems = [];
|
this.resultItems = [];
|
||||||
|
|
|
@ -209,7 +209,7 @@ define([
|
||||||
this.supressEvents = false;
|
this.supressEvents = false;
|
||||||
|
|
||||||
this.onCoauthOptions();
|
this.onCoauthOptions();
|
||||||
(btn.options.action == 'advancedsearch') && this.fireEvent('search:aftershow', this);
|
btn.pressed && btn.options.action == 'advancedsearch' && this.fireEvent('search:aftershow', this);
|
||||||
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -337,10 +337,10 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.hideResults();
|
this.hideResults();
|
||||||
if (text !== '' && text === this._state.searchText) { // search was made
|
if (text && text !== '' && text === this._state.searchText) { // search was made
|
||||||
this.view.disableReplaceButtons(false);
|
this.view.disableReplaceButtons(false);
|
||||||
this.api.asc_StartTextAroundSearch();
|
this.api.asc_StartTextAroundSearch();
|
||||||
} else if (text !== '') { // search wasn't made
|
} else if (text && text !== '') { // search wasn't made
|
||||||
this.onInputSearchChange(text);
|
this.onInputSearchChange(text);
|
||||||
} else {
|
} else {
|
||||||
this.resultItems = [];
|
this.resultItems = [];
|
||||||
|
|
|
@ -202,7 +202,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fireEvent('panel:show', [this, btn.options.action, btn.pressed]);
|
this.fireEvent('panel:show', [this, btn.options.action, btn.pressed]);
|
||||||
(btn.options.action == 'advancedsearch') && this.fireEvent('search:aftershow', this);
|
btn.pressed && btn.options.action == 'advancedsearch' && this.fireEvent('search:aftershow', this);
|
||||||
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -482,7 +482,7 @@ define([
|
||||||
|
|
||||||
var text = typeof findText === 'string' ? findText : (this.api.asc_GetSelectedText() || this._state.searchText);
|
var text = typeof findText === 'string' ? findText : (this.api.asc_GetSelectedText() || this._state.searchText);
|
||||||
if (this.resultItems && this.resultItems.length > 0 &&
|
if (this.resultItems && this.resultItems.length > 0 &&
|
||||||
(!this._state.matchCase && text.toLowerCase() === this.view.inputText.getValue().toLowerCase() ||
|
(!this._state.matchCase && text && text.toLowerCase() === this.view.inputText.getValue().toLowerCase() ||
|
||||||
this._state.matchCase && text === this.view.inputText.getValue())) { // show old results
|
this._state.matchCase && text === this.view.inputText.getValue())) { // show old results
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -494,10 +494,10 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.hideResults();
|
this.hideResults();
|
||||||
if (text !== '' && text === this._state.searchText) { // search was made
|
if (text && text !== '' && text === this._state.searchText) { // search was made
|
||||||
this.view.disableReplaceButtons(false);
|
this.view.disableReplaceButtons(false);
|
||||||
this.api.asc_StartTextAroundSearch();
|
this.api.asc_StartTextAroundSearch();
|
||||||
} else if (text !== '') { // search wasn't made
|
} else if (text && text !== '') { // search wasn't made
|
||||||
this.onInputSearchChange(text);
|
this.onInputSearchChange(text);
|
||||||
} else {
|
} else {
|
||||||
this.resultItems = [];
|
this.resultItems = [];
|
||||||
|
|
|
@ -183,7 +183,7 @@ define([
|
||||||
this.$el.width(SCALE_MIN);
|
this.$el.width(SCALE_MIN);
|
||||||
}
|
}
|
||||||
this.onCoauthOptions();
|
this.onCoauthOptions();
|
||||||
(btn.options.action == 'advancedsearch') && this.fireEvent('search:aftershow', this);
|
btn.pressed && btn.options.action == 'advancedsearch' && this.fireEvent('search:aftershow', this);
|
||||||
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue