File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 10
10
*/
11
11
( function ( $ , undefined ) {
12
12
13
- var uuid = 0 ,
14
- runiqueId = / ^ u i - i d - \d + $ / ;
15
-
16
13
// $.ui might exist from components with no dependencies, e.g., $.ui.position
17
14
$ . ui = $ . ui || { } ;
18
15
@@ -72,17 +69,21 @@ $.fn.extend({
72
69
return ( / f i x e d / ) . test ( this . css ( "position" ) ) || ! scrollParent . length ? $ ( this [ 0 ] . ownerDocument || document ) : scrollParent ;
73
70
} ,
74
71
75
- uniqueId : function ( ) {
76
- return this . each ( function ( ) {
77
- if ( ! this . id ) {
78
- this . id = "ui-id-" + ( ++ uuid ) ;
79
- }
80
- } ) ;
81
- } ,
72
+ uniqueId : ( function ( ) {
73
+ var uuid = 0 ;
74
+
75
+ return function ( ) {
76
+ return this . each ( function ( ) {
77
+ if ( ! this . id ) {
78
+ this . id = "ui-id-" + ( ++ uuid ) ;
79
+ }
80
+ } ) ;
81
+ } ;
82
+ } ) ( ) ,
82
83
83
84
removeUniqueId : function ( ) {
84
85
return this . each ( function ( ) {
85
- if ( runiqueId . test ( this . id ) ) {
86
+ if ( / ^ u i - i d - \d + $ / . test ( this . id ) ) {
86
87
$ ( this ) . removeAttr ( "id" ) ;
87
88
}
88
89
} ) ;
You can’t perform that action at this time.
0 commit comments