Sfoglia il codice sorgente

make the option element available to the matcher function when attached to select. can be used to match on option attributes as well as option text. fixes #227

Igor Vaynberg 13 anni fa
parent
commit
3a830a2b81
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -622,7 +622,7 @@
                     process=function(element, collection) {
                         var group;
                         if (element.is("option")) {
-                            if (query.matcher(term, element.text())) {
+                            if (query.matcher(term, element.text(), element)) {
                                 collection.push({id:element.attr("value"), text:element.text(), element: element.get()});
                             }
                         } else if (element.is("optgroup")) {