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.core.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.core.js')
-rw-r--r-- | ui/jquery.ui.core.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 9145d5d45..7faae0760 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -10,9 +10,6 @@ */ (function( $, undefined ) { -var uuid = 0, - runiqueId = /^ui-id-\d+$/; - // $.ui might exist from components with no dependencies, e.g., $.ui.position $.ui = $.ui || {}; @@ -72,17 +69,21 @@ $.fn.extend({ return ( /fixed/ ).test( this.css( "position") ) || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; }, - uniqueId: function() { - return this.each(function() { - if ( !this.id ) { - this.id = "ui-id-" + (++uuid); - } - }); - }, + uniqueId: (function() { + var uuid = 0; + + return function() { + return this.each(function() { + if ( !this.id ) { + this.id = "ui-id-" + ( ++uuid ); + } + }); + }; + })(), removeUniqueId: function() { return this.each(function() { - if ( runiqueId.test( this.id ) ) { + if ( /^ui-id-\d+$/.test( this.id ) ) { $( this ).removeAttr( "id" ); } }); |