corrade-http-templates – Blame information for rev 62

Subversion Repositories:
Rev:
Rev Author Line No. Line
62 office 1 /*!
2 * jQuery UI Unique ID 1.12.1
3 * http://jqueryui.com
4 *
5 * Copyright jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
8 */
9  
10 //>>label: uniqueId
11 //>>group: Core
12 //>>description: Functions to generate and remove uniqueId's
13 //>>docs: http://api.jqueryui.com/uniqueId/
14  
15 ( function( factory ) {
16 if ( typeof define === "function" && define.amd ) {
17  
18 // AMD. Register as an anonymous module.
19 define( [ "jquery", "./version" ], factory );
20 } else {
21  
22 // Browser globals
23 factory( jQuery );
24 }
25 } ( function( $ ) {
26  
27 return $.fn.extend( {
28 uniqueId: ( function() {
29 var uuid = 0;
30  
31 return function() {
32 return this.each( function() {
33 if ( !this.id ) {
34 this.id = "ui-id-" + ( ++uuid );
35 }
36 } );
37 };
38 } )(),
39  
40 removeUniqueId: function() {
41 return this.each( function() {
42 if ( /^ui-id-\d+$/.test( this.id ) ) {
43 $( this ).removeAttr( "id" );
44 }
45 } );
46 }
47 } );
48  
49 } ) );