]> 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>
Sat, 7 Jul 2012 18:28:52 +0000 (14:28 -0400)
ui/jquery.ui.core.js

index ad0ab25d71f80b047d9152a54287bfcd306707f7..3e102f181e03b8cf3cec4385ee8b66ce8ed45b71 100644 (file)
@@ -216,9 +216,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" ) ) );