r2795 - moved _genIds method into init and refactored it

r2795 - moved _genIds method into init and refactored it


Author: scottjehl
Date: Tue Jun 16 14:51:42 2009
New Revision: 2795
Modified:
branches/labs/selectmenu/ui.selectmenu.js
Log:
moved _genIds method into init and refactored it
Modified: branches/labs/selectmenu/ui.selectmenu.js
==============================================================================
--- branches/labs/selectmenu/ui.selectmenu.js    (original)
+++ branches/labs/selectmenu/ui.selectmenu.js    Tue Jun 16 14:51:42 2009
@@ -15,7 +15,8 @@
        var self = this, o = this.options;
        
        //quick array of button and menu id's
-        this.ids = this._genId();
+        var num = Math.round(Math.random() * 1000);
+        this.ids = [this.element.attr('id') + '_' + 'button' + '_' + num,
this.element.attr('id') + '_' + 'menu' + '_' + num];
        
        //define safe mouseup for future toggling
        this._safemouseup = true;
@@ -340,10 +341,6 @@
        $('.'+ this.widgetBaseClass
+'.ui-state-active').not(this.newelement).each(function(){
            $(this).data('selectelement').selectmenu('close');
        })
-    },
-    _genId: function(type){
-        var num = Math.round(Math.random() * 1000);
-        return [this.element.attr('id') + '_' + 'button' + '_' + num,
this.element.attr('id') + '_' + 'menu' + '_' + num];
    },
    open: function(){
        var self = this;