Closes #1015: do not override the jQuery contains() function by defining our own with that name; rather use the one from Underscore.

This commit is contained in:
Georg Brandl 2012-10-28 18:40:52 +01:00
parent f29ff1b468
commit c573d61207
2 changed files with 2 additions and 14 deletions

View File

@ -61,18 +61,6 @@ jQuery.getQueryParameters = function(s) {
return result;
};
/**
* small function to check if an array contains
* a given item.
*/
jQuery.contains = function(arr, item) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == item)
return true;
}
return false;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.

View File

@ -150,7 +150,7 @@ var Search = {
hlterms.push(tmp[i].toLowerCase());
}
// only add if not already in the list
if (!$.contains(toAppend, word))
if (!$u.contains(toAppend, word))
toAppend.push(word);
};
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
@ -217,7 +217,7 @@ var Search = {
// search result.
for (var i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
$.contains(terms[excluded[i]] || [], file)) {
$u.contains(terms[excluded[i]] || [], file)) {
valid = false;
break;
}