equal( el.height(), 32, "height set properly when hidden" );
});
+test( "uniqueId / removeUniqueId", function() {
+ var el = $( "img" ).eq( 0 );
+
+ equal( el.attr( "id" ), undefined, "element has no initial id" );
+ el.uniqueId();
+ ok( /ui-id-\d+$/.test( el.attr( "id" ) ), "element has generated id" );
+ el.removeUniqueId();
+ equal( el.attr( "id" ), undefined, "unique id has been removed from element" );
+});
+
})( jQuery );
*/
(function( $, undefined ) {
+var uuid = 0,
+ runiqueId = /^ui-id-\d+$/;
+
// prevent duplicate loading
// this is only a problem because we proxy existing functions
// and we don't want to double proxy them
return 0;
},
+ uniqueId: function() {
+ return this.each(function() {
+ if ( !this.id ) {
+ this.id = "ui-id-" + (++uuid);
+ }
+ });
+ },
+
+ removeUniqueId: function() {
+ return this.each(function() {
+ if ( runiqueId.test( this.id ) ) {
+ $( this ).removeAttr( "id" );
+ }
+ });
+ },
+
disableSelection: function() {
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
".ui-disableSelection", function( event ) {