From 3a830a2b81755bd0ba754defa4899cf164f13fc7 Mon Sep 17 00:00:00 2001
From: Igor Vaynberg <igor.vaynberg@gmail.com>
Date: Tue, 17 Jul 2012 16:39:28 +0300
Subject: [PATCH] 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

---
 select2.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/select2.js b/select2.js
index 54b9b7c8..87b994af 100755
--- a/select2.js
+++ b/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")) {