aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2015-07-15 16:43:33 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2015-08-08 00:29:36 -0400
commitf0260fd91b593ae56f68e1f33ca8496c1c4b0467 (patch)
tree2a68e32188b4a9c81ed37820232feaeae11a797a /ui
parent3d71fb83fe02a307823594f5905be9848cfa5506 (diff)
downloadjquery-ui-f0260fd91b593ae56f68e1f33ca8496c1c4b0467.tar.gz
jquery-ui-f0260fd91b593ae56f68e1f33ca8496c1c4b0467.zip
Core: Move data selector from core into its own module
Ref #9647
Diffstat (limited to 'ui')
-rw-r--r--ui/button.js1
-rw-r--r--ui/core.js12
-rw-r--r--ui/data.js38
-rw-r--r--ui/draggable.js3
-rw-r--r--ui/sortable.js1
5 files changed, 43 insertions, 12 deletions
diff --git a/ui/button.js b/ui/button.js
index 34228e2da..8c9894044 100644
--- a/ui/button.js
+++ b/ui/button.js
@@ -23,6 +23,7 @@
define([
"jquery",
"./core",
+ "./data",
"./version",
"./widget"
], factory );
diff --git a/ui/core.js b/ui/core.js
index a529f35db..6cf599964 100644
--- a/ui/core.js
+++ b/ui/core.js
@@ -20,6 +20,7 @@
// AMD. Register as an anonymous module.
define( [
"jquery",
+ "./data",
"./version" ], factory );
} else {
@@ -207,17 +208,6 @@ function visible( element ) {
}
$.extend( $.expr[ ":" ], {
- 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, $.attr( element, "tabindex" ) != null );
},
diff --git a/ui/data.js b/ui/data.js
new file mode 100644
index 000000000..e989902da
--- /dev/null
+++ b/ui/data.js
@@ -0,0 +1,38 @@
+/*!
+ * jQuery UI :data @VERSION
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: :data
+//>>group: Core
+//>>description: Selects elements which have data stored under the specified key.
+//>>docs: http://api.jqueryui.com/data-selector/
+
+( function( factory ) {
+ if ( typeof define === "function" && define.amd ) {
+
+ // AMD. Register as an anonymous module.
+ define( [ "jquery", "./version" ], factory );
+ } else {
+
+ // Browser globals
+ factory( jQuery );
+ }
+} ( function( $ ) {
+return $.extend( $.expr[ ":" ], {
+ 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 ] );
+ }
+} );
+} ) );
diff --git a/ui/draggable.js b/ui/draggable.js
index 261be7b48..47855e157 100644
--- a/ui/draggable.js
+++ b/ui/draggable.js
@@ -21,8 +21,9 @@
define([
"jquery",
"./core",
- "./version",
+ "./data",
"./mouse",
+ "./version",
"./widget"
], factory );
} else {
diff --git a/ui/sortable.js b/ui/sortable.js
index 0c638906d..8bd267649 100644
--- a/ui/sortable.js
+++ b/ui/sortable.js
@@ -21,6 +21,7 @@
define([
"jquery",
"./core",
+ "./data",
"./mouse",
"./version",
"./widget"