aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-10-23 08:14:49 -0400
committerScott González <scott.gonzalez@gmail.com>2013-10-24 09:19:42 -0400
commit47db52b9c98a5c593eb86e5b75309568d11b3bef (patch)
tree3708ccc9860f9ddbf53e9c0e535f96af5fcf21f4 /ui
parentf64c95349744f63ee3677e82ff05338adeb5974a (diff)
downloadjquery-ui-47db52b9c98a5c593eb86e5b75309568d11b3bef.tar.gz
jquery-ui-47db52b9c98a5c593eb86e5b75309568d11b3bef.zip
Widget: Prefix variables with component name.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.widget.js32
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,