| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
( function( factory ) { |
| 16 |
"use strict"; |
| 17 |
|
| 18 |
if ( typeof define === "function" && define.amd ) { |
| 19 |
|
| 20 |
|
| 21 |
define( [ "jquery", "./version" ], factory ); |
| 22 |
} else { |
| 23 |
|
| 24 |
|
| 25 |
factory( jQuery ); |
| 26 |
} |
| 27 |
} )( function( $ ) { |
| 28 |
"use strict"; |
| 29 |
|
| 30 |
return $.fn.extend( { |
| 31 |
uniqueId: ( function() { |
| 32 |
var uuid = 0; |
| 33 |
|
| 34 |
return function() { |
| 35 |
return this.each( function() { |
| 36 |
if ( !this.id ) { |
| 37 |
this.id = "ui-id-" + ( ++uuid ); |
| 38 |
} |
| 39 |
} ); |
| 40 |
}; |
| 41 |
} )(), |
| 42 |
|
| 43 |
removeUniqueId: function() { |
| 44 |
return this.each( function() { |
| 45 |
if ( /^ui-id-\d+$/.test( this.id ) ) { |
| 46 |
$( this ).removeAttr( "id" ); |
| 47 |
} |
| 48 |
} ); |
| 49 |
} |
| 50 |
} ); |
| 51 |
|
| 52 |
} ); |