[FIX] base: settings view match on label.text
Before this commit, search was broken because containsLike was searching on
the innerHtml. (3dd93ed129)
Settings use _wordHighlighter to change the background of the matching text
into the label, so the label was not only text, but html.
<label><span class="highlighter">Mul</span>ti-company</label>
: looking for (mul)
After this commit, the match is based on the text content and not on the html.
This commit is contained in:
+3
@@ -11,6 +11,9 @@ $.extend($.expr[':'], {
|
||||
containsLike: function (element, index, matches){
|
||||
return element.innerHTML.toUpperCase().indexOf(matches[3].toUpperCase()) >= 0;
|
||||
},
|
||||
containsTextLike: function (element, index, matches){
|
||||
return element.innerText.toUpperCase().indexOf(matches[3].toUpperCase()) >= 0;
|
||||
},
|
||||
containsExact: function (element, index, matches){
|
||||
return $.trim(element.innerHTML) === matches[3];
|
||||
},
|
||||
|
||||
@@ -277,7 +277,7 @@ var BaseSettingRenderer = FormRenderer.extend({
|
||||
module.settingView.find('h2').addClass('o_hidden');
|
||||
module.settingView.find('.settingSearchHeader').addClass('o_hidden');
|
||||
module.settingView.find('.o_settings_container').removeClass('mt16');
|
||||
var resultSetting = module.settingView.find("label:containsLike('" + self.searchText + "')");
|
||||
var resultSetting = module.settingView.find("label:containsTextLike('" + self.searchText + "')");
|
||||
if (resultSetting.length > 0) {
|
||||
resultSetting.each(function () {
|
||||
var settingBox = $(this).closest('.o_setting_box');
|
||||
|
||||
Reference in New Issue
Block a user