summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2018-03-22 10:04:36 +0100
committerJeremy Kersten <jke@odoo.com>2018-03-22 11:22:33 +0100
commit38e339258ccc391cc9ab021c31f63da3d0749b87 (patch)
treed8612c1d1cb6d7e898f58413cd20e46f2d261236 /addons/web/static
parenta8230853e8913e9186274a20294226ce824f5478 (diff)
[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.
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/js/libs/jquery.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/libs/jquery.js b/addons/web/static/src/js/libs/jquery.js
index 0b12b4fed0d..4bcab8eb866 100644
--- a/addons/web/static/src/js/libs/jquery.js
+++ b/addons/web/static/src/js/libs/jquery.js
@@ -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];
},