diff options
author | Felix Nagel <info@felixnagel.com> | 2013-11-13 19:45:56 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-11-13 19:45:56 +0100 |
commit | ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f (patch) | |
tree | dedf39afe3330bae4eec603297432d972e5bcfc1 /ui/jquery.ui.widget.js | |
parent | a6c5f58d8243b39c6cd57b76ffb0776adfcc8b1c (diff) | |
parent | 14782c04e2201c53e3ecb80b086f1a4c27aa991d (diff) | |
download | jquery-ui-ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f.tar.gz jquery-ui-ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r-- | ui/jquery.ui.widget.js | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index cc01f784f..97f5fd7e0 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -10,18 +10,20 @@ */ (function( $, undefined ) { -var uuid = 0, - slice = Array.prototype.slice, - _cleanData = $.cleanData; -$.cleanData = function( elems ) { - for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { - try { - $( elem ).triggerHandler( "remove" ); - // http://bugs.jquery.com/ticket/8235 - } catch( e ) {} - } - _cleanData( elems ); -}; +var widget_uuid = 0, + widget_slice = Array.prototype.slice; + +$.cleanData = (function( orig ) { + return function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + orig( elems ); + }; +})( $.cleanData ); $.widget = function( name, base, prototype ) { var fullName, existingConstructor, constructor, basePrototype, @@ -139,7 +141,7 @@ $.widget = function( name, base, prototype ) { }; $.widget.extend = function( target ) { - var input = slice.call( arguments, 1 ), + var input = widget_slice.call( arguments, 1 ), inputIndex = 0, inputLength = input.length, key, @@ -168,7 +170,7 @@ $.widget.bridge = function( name, object ) { var fullName = object.prototype.widgetFullName || name; $.fn[ name ] = function( options ) { var isMethodCall = typeof options === "string", - args = slice.call( arguments, 1 ), + args = widget_slice.call( arguments, 1 ), returnValue = this; // allow multiple hashes to be passed on init @@ -233,7 +235,7 @@ $.Widget.prototype = { _createWidget: function( options, element ) { element = $( element || this.defaultElement || this )[ 0 ]; this.element = $( element ); - this.uuid = uuid++; + this.uuid = widget_uuid++; this.eventNamespace = "." + this.widgetName + this.uuid; this.options = $.widget.extend( {}, this.options, |