]> source.dussan.org Git - jquery-ui.git/commitdiff
Core: Adjust data pseudo creation to use new Sizzle pseudo creation for pseudos with...
authorTimmy Willison <timmywillisn@gmail.com>
Sat, 7 Jul 2012 18:28:52 +0000 (14:28 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 11 Jul 2012 12:20:32 +0000 (08:20 -0400)
(cherry picked from commit 2d643032c553ea2804946b4f0cdba4b7820e1bfc)

ui/jquery.ui.core.js

index 53aa51b5f00ef77068806cea481fa717a835e386..1d002eceaed6d05bde8234c9132cce6d2159176e 100644 (file)
@@ -205,9 +205,16 @@ function visible( element ) {
 }
 
 $.extend( $.expr[ ":" ], {
-       data: function( elem, i, match ) {
-               return !!$.data( elem, match[ 3 ] );
-       },
+       data: $.expr.createPseudo ?
+               $.expr.createPseudo(function( dataName ) {
+                       return function( elem ) {
+                               return !!$.data( elem, dataName );
+                       };
+               }) :
+               // support: jQuery <1.8
+               function( elem, i, match ) {
+                       return !!$.data( elem, match[ 3 ] );
+               },
 
        focusable: function( element ) {
                return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );