From 7932007dc5756b28cbdb6b824f0299a827c61fa8 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 24 Nov 2012 00:27:46 +0100 Subject: [PATCH] fixed: improved unique ID generation --- ui/jquery.ui.selectmenu.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 1d79043df..12c676fd5 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -28,13 +28,13 @@ $.widget("ui.selectmenu", { _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; -- 2.39.5