diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/data/Data.js | 7 | ||||
-rw-r--r-- | src/data/var/acceptData.js (renamed from src/data/accepts.js) | 8 | ||||
-rw-r--r-- | src/event.js | 10 | ||||
-rw-r--r-- | src/manipulation.js | 6 |
4 files changed, 13 insertions, 18 deletions
diff --git a/src/data/Data.js b/src/data/Data.js index 476b3e1e2..a19476ea6 100644 --- a/src/data/Data.js +++ b/src/data/Data.js @@ -1,15 +1,14 @@ define( [ "../core", "../var/rnotwhite", - "./accepts" -], function( jQuery, rnotwhite ) { + "./var/acceptData" +], function( jQuery, rnotwhite, acceptData ) { function Data() { this.expando = jQuery.expando + Data.uid++; } Data.uid = 1; -Data.accepts = jQuery.acceptData; Data.prototype = { @@ -38,7 +37,7 @@ Data.prototype = { // We can accept data for non-element nodes in modern browsers, // but we should not, see #8335. // Always return an empty object. - if ( !Data.accepts( owner ) ) { + if ( !acceptData( owner ) ) { return {}; } diff --git a/src/data/accepts.js b/src/data/var/acceptData.js index 24e2f0ef0..6a1e5021b 100644 --- a/src/data/accepts.js +++ b/src/data/var/acceptData.js @@ -1,12 +1,9 @@ -define( [ - "../core" -], function( jQuery ) { +define( function() { /** * Determines whether an object can have data */ -jQuery.acceptData = function( owner ) { - +return function( owner ) { // Accepts only: // - Node // - Node.ELEMENT_NODE @@ -17,5 +14,4 @@ jQuery.acceptData = function( owner ) { return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); }; -return jQuery.acceptData; } ); diff --git a/src/event.js b/src/event.js index 8a059ca8a..233fd4348 100644 --- a/src/event.js +++ b/src/event.js @@ -6,11 +6,11 @@ define( [ "./var/slice", "./event/support", "./data/var/dataPriv", + "./data/var/acceptData", "./core/init", - "./data/accepts", "./selector" -], function( jQuery, document, rnotwhite, hasOwn, slice, support, dataPriv ) { +], function( jQuery, document, rnotwhite, hasOwn, slice, support, dataPriv, acceptData ) { var rkeyEvent = /^key/, @@ -376,7 +376,7 @@ jQuery.event = { // Native handler handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { + if ( handle && handle.apply && acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); @@ -389,8 +389,8 @@ jQuery.event = { if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - jQuery.acceptData( elem ) ) { + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Don't do default actions on window, that's where global variables be (#6170) diff --git a/src/manipulation.js b/src/manipulation.js index 55a77f4e8..227d0ef9e 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -14,16 +14,16 @@ define( [ "./data/var/dataPriv", "./data/var/dataUser", + "./data/var/acceptData", "./core/init", - "./data/accepts", "./traversing", "./selector", "./event" ], function( jQuery, concat, push, access, rcheckableType, rtagName, rscriptType, wrapMap, getAll, setGlobalEval, buildFragment, support, - dataPriv, dataUser ) { + dataPriv, dataUser, acceptData ) { var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, @@ -273,7 +273,7 @@ jQuery.extend( { i = 0; for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( jQuery.acceptData( elem ) ) { + if ( acceptData( elem ) ) { if ( ( data = elem[ dataPriv.expando ] ) ) { if ( data.events ) { for ( type in data.events ) { |