_create: function() {
var self = this, o = this.options;
-
- // set a default id value, generate a new random one if not set by developer
- var selectmenuId = ( this.element.attr( 'id' ) || 'ui-selectmenu-' + Math.random().toString( 16 ).slice( 2, 10 ) ).replace( /(:|\.)/g, '' )
+
+ // make / set unique id
+ var selectmenuId = this.element.uniqueId().attr( "id" );
// quick array of button and menu id's
this.ids = [ selectmenuId, selectmenuId + '-button', selectmenuId + '-menu' ];
-
+
// define safe mouseup for future toggling
this._safemouseup = true;
this.isOpen = false;