From: Timmy Willison Date: Sat, 7 Jul 2012 18:28:52 +0000 (-0400) Subject: Core: Adjust data pseudo creation to use new Sizzle pseudo creation for pseudos with... X-Git-Tag: 1.8.22~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7427d39b39d0e1f07a8dd5a4a9a879db1cd5d46b;p=jquery-ui.git Core: Adjust data pseudo creation to use new Sizzle pseudo creation for pseudos with arguments. (cherry picked from commit 2d643032c553ea2804946b4f0cdba4b7820e1bfc) --- diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 53aa51b5f..1d002ecea 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -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" ) ) );