*/
(function( $, undefined ) {
-var uuid = 0,
- runiqueId = /^ui-id-\d+$/;
-
// $.ui might exist from components with no dependencies, e.g., $.ui.position
$.ui = $.ui || {};
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" );
}
});