Commits

Georg Brandl committed 8de914b

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

  • Participants
  • Parent commits e631440

Comments (0)

Files changed (2)

File sphinx/themes/basic/static/doctools.js

 };
 
 /**
- * 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.
  */

File sphinx/themes/basic/static/searchtools.js_t

         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(" "));
       // 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;
         }