mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Change variables initialization sequence for some declarations
This commit is contained in:
parent
dc931af877
commit
e392e5579b
@ -166,7 +166,7 @@ jQuery.fn.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
val: function( value ) {
|
val: function( value ) {
|
||||||
var hooks, ret, isFunction,
|
var ret, hooks, isFunction,
|
||||||
elem = this[0];
|
elem = this[0];
|
||||||
|
|
||||||
if ( !arguments.length ) {
|
if ( !arguments.length ) {
|
||||||
|
@ -40,18 +40,18 @@ jQuery.Callbacks = function( options ) {
|
|||||||
( optionsCache[ options ] || createOptions( options ) ) :
|
( optionsCache[ options ] || createOptions( options ) ) :
|
||||||
jQuery.extend( {}, options );
|
jQuery.extend( {}, options );
|
||||||
|
|
||||||
var // Last fire value (for non-forgettable lists)
|
var // Flag to know if list is currently firing
|
||||||
|
firing,
|
||||||
|
// Last fire value (for non-forgettable lists)
|
||||||
memory,
|
memory,
|
||||||
// Flag to know if list was already fired
|
// Flag to know if list was already fired
|
||||||
fired,
|
fired,
|
||||||
// Flag to know if list is currently firing
|
|
||||||
firing,
|
|
||||||
// First callback to fire (used internally by add and fireWith)
|
// First callback to fire (used internally by add and fireWith)
|
||||||
firingStart,
|
firingStart,
|
||||||
// End of the loop when firing
|
|
||||||
firingLength,
|
|
||||||
// Index of currently firing callback (modified by remove if needed)
|
// Index of currently firing callback (modified by remove if needed)
|
||||||
firingIndex,
|
firingIndex,
|
||||||
|
// End of the loop when firing
|
||||||
|
firingLength,
|
||||||
// Actual callback list
|
// Actual callback list
|
||||||
list = [],
|
list = [],
|
||||||
// Stack of fire calls for repeatable lists
|
// Stack of fire calls for repeatable lists
|
||||||
|
@ -93,7 +93,7 @@ jQuery.fn = jQuery.prototype = {
|
|||||||
|
|
||||||
constructor: jQuery,
|
constructor: jQuery,
|
||||||
init: function( selector, context, rootjQuery ) {
|
init: function( selector, context, rootjQuery ) {
|
||||||
var match, elem;
|
var elem, match;
|
||||||
|
|
||||||
// HANDLE: $(""), $(null), $(undefined), $(false)
|
// HANDLE: $(""), $(null), $(undefined), $(false)
|
||||||
if ( !selector ) {
|
if ( !selector ) {
|
||||||
@ -288,7 +288,7 @@ jQuery.fn = jQuery.prototype = {
|
|||||||
jQuery.fn.init.prototype = jQuery.fn;
|
jQuery.fn.init.prototype = jQuery.fn;
|
||||||
|
|
||||||
jQuery.extend = jQuery.fn.extend = function() {
|
jQuery.extend = jQuery.fn.extend = function() {
|
||||||
var options, name, src, copy, copyIsArray, clone,
|
var copy, options, src, copyIsArray, name, clone,
|
||||||
target = arguments[0] || {},
|
target = arguments[0] || {},
|
||||||
i = 1,
|
i = 1,
|
||||||
length = arguments.length,
|
length = arguments.length,
|
||||||
@ -770,7 +770,7 @@ jQuery.extend({
|
|||||||
// Bind a function to a context, optionally partially applying any
|
// Bind a function to a context, optionally partially applying any
|
||||||
// arguments.
|
// arguments.
|
||||||
proxy: function( fn, context ) {
|
proxy: function( fn, context ) {
|
||||||
var tmp, args, proxy;
|
var args, proxy, tmp;
|
||||||
|
|
||||||
if ( typeof context === "string" ) {
|
if ( typeof context === "string" ) {
|
||||||
tmp = fn[ context ];
|
tmp = fn[ context ];
|
||||||
|
16
src/event.js
16
src/event.js
@ -22,9 +22,9 @@ jQuery.event = {
|
|||||||
|
|
||||||
add: function( elem, types, handler, data, selector ) {
|
add: function( elem, types, handler, data, selector ) {
|
||||||
|
|
||||||
var handleObjIn, eventHandle, tmp,
|
var handleObjIn, tmp, eventHandle,
|
||||||
events, t, handleObj,
|
t, handleObj, special,
|
||||||
special, handlers, type, namespaces, origType,
|
events, handlers, type, namespaces, origType,
|
||||||
elemData = jQuery._data( elem );
|
elemData = jQuery._data( elem );
|
||||||
|
|
||||||
// Don't attach events to noData or text/comment nodes (but allow plain objects)
|
// Don't attach events to noData or text/comment nodes (but allow plain objects)
|
||||||
@ -133,8 +133,8 @@ jQuery.event = {
|
|||||||
// Detach an event or set of events from an element
|
// Detach an event or set of events from an element
|
||||||
remove: function( elem, types, handler, selector, mappedTypes ) {
|
remove: function( elem, types, handler, selector, mappedTypes ) {
|
||||||
|
|
||||||
var j, origCount, tmp,
|
var events, handleObj, tmp,
|
||||||
events, t, handleObj,
|
j, t, origCount,
|
||||||
special, handlers, type, namespaces, origType,
|
special, handlers, type, namespaces, origType,
|
||||||
elemData = jQuery.hasData( elem ) && jQuery._data( elem );
|
elemData = jQuery.hasData( elem ) && jQuery._data( elem );
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ jQuery.event = {
|
|||||||
|
|
||||||
trigger: function( event, data, elem, onlyHandlers ) {
|
trigger: function( event, data, elem, onlyHandlers ) {
|
||||||
|
|
||||||
var i, cur, tmp, bubbleType, ontype, handle, special,
|
var i, handle, ontype, bubbleType, tmp, special, cur,
|
||||||
eventPath = [ elem || document ],
|
eventPath = [ elem || document ],
|
||||||
type = event.type || event,
|
type = event.type || event,
|
||||||
namespaces = event.namespace ? event.namespace.split(".") : [];
|
namespaces = event.namespace ? event.namespace.split(".") : [];
|
||||||
@ -343,7 +343,7 @@ jQuery.event = {
|
|||||||
// Make a writable jQuery.Event from the native event object
|
// Make a writable jQuery.Event from the native event object
|
||||||
event = jQuery.event.fix( event );
|
event = jQuery.event.fix( event );
|
||||||
|
|
||||||
var i, j, ret, matched, handleObj,
|
var ret, j, handleObj, matched, i,
|
||||||
handlerQueue = [],
|
handlerQueue = [],
|
||||||
args = core_slice.call( arguments ),
|
args = core_slice.call( arguments ),
|
||||||
handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
|
handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
|
||||||
@ -876,7 +876,7 @@ if ( !jQuery.support.focusinBubbles ) {
|
|||||||
jQuery.fn.extend({
|
jQuery.fn.extend({
|
||||||
|
|
||||||
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
|
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
|
||||||
var origFn, type;
|
var type, origFn;
|
||||||
|
|
||||||
// Types can be a map of types/handlers
|
// Types can be a map of types/handlers
|
||||||
if ( typeof types === "object" ) {
|
if ( typeof types === "object" ) {
|
||||||
|
@ -285,7 +285,7 @@ jQuery.fn.extend({
|
|||||||
// Flatten any nested arrays
|
// Flatten any nested arrays
|
||||||
args = core_concat.apply( [], args );
|
args = core_concat.apply( [], args );
|
||||||
|
|
||||||
var fragment, first, scripts, hasScripts, node, doc,
|
var scripts, node, doc, fragment, hasScripts, first,
|
||||||
i = 0,
|
i = 0,
|
||||||
l = this.length,
|
l = this.length,
|
||||||
set = this,
|
set = this,
|
||||||
@ -559,7 +559,7 @@ function fixDefaultChecked( elem ) {
|
|||||||
|
|
||||||
jQuery.extend({
|
jQuery.extend({
|
||||||
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
||||||
var destElements, srcElements, node, i, clone,
|
var clone, node, srcElements, i, destElements,
|
||||||
inPage = jQuery.contains( elem.ownerDocument, elem );
|
inPage = jQuery.contains( elem.ownerDocument, elem );
|
||||||
|
|
||||||
if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
|
if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
|
||||||
@ -614,7 +614,7 @@ jQuery.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
buildFragment: function( elems, context, scripts, selection ) {
|
buildFragment: function( elems, context, scripts, selection ) {
|
||||||
var contains, elem, tag, tmp, wrap, tbody, j,
|
var contains, elem, j, tmp, tag, wrap, tbody,
|
||||||
l = elems.length,
|
l = elems.length,
|
||||||
|
|
||||||
// Ensure a safe fragment
|
// Ensure a safe fragment
|
||||||
@ -740,7 +740,7 @@ jQuery.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
cleanData: function( elems, /* internal */ acceptData ) {
|
cleanData: function( elems, /* internal */ acceptData ) {
|
||||||
var data, id, elem, type,
|
var elem, id, type, data,
|
||||||
i = 0,
|
i = 0,
|
||||||
internalKey = jQuery.expando,
|
internalKey = jQuery.expando,
|
||||||
cache = jQuery.cache,
|
cache = jQuery.cache,
|
||||||
|
Loading…
Reference in New Issue
Block a user