r2798 - added _uiHash() method and added ui.button and ui.menu to ui hash callback.
Author: scottjehl
Date: Tue Jun 16 15:48:28 2009
New Revision: 2798
Modified:
branches/labs/selectmenu/ui.selectmenu.js
Log:
added _uiHash() method and added ui.button and ui.menu to ui hash callback.
Modified: branches/labs/selectmenu/ui.selectmenu.js
==============================================================================
--- branches/labs/selectmenu/ui.selectmenu.js (original)
+++ branches/labs/selectmenu/ui.selectmenu.js Tue Jun 16 15:48:28 2009
@@ -340,6 +340,13 @@
});
this._prevChar[0] = C;
},
+ _uiHash: function(){
+ return {
+ value: this.value(),
+ button: this.newelement,
+ menu: this.list
+ };
+ },
open: function(event){
var self = this;
this._refreshPosition();
@@ -351,10 +358,7 @@
.find('li:not(.'+ self.widgetBaseClass +'-group):eq('+
this._selectedIndex() +') a').focus();
if(this.options.style == "dropdown"){
this.newelement.removeClass('ui-corner-all').addClass('ui-corner-top'); }
this._refreshPosition();
- var uiHash = {
- value: this.value()
- };
- this._trigger("open", event, uiHash);
+ this._trigger("open", event, this._uiHash());
},
close: function(event, retainFocus){
if(this.newelement.is('.ui-state-active')){
@@ -362,23 +366,14 @@
this.list.removeClass(this.widgetBaseClass+'-open');
if(this.options.style == "dropdown"){
this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all'); }
if(retainFocus){this.newelement.focus();}
- var uiHash = {
- value: this.value()
- };
- this._trigger("close", event, uiHash);
+ this._trigger("close", event, this._uiHash());
}
},
change: function(event) {
- var uiHash = {
- value: this.value()
- };
- this._trigger("change", event, uiHash);
+ this._trigger("change", event, this._uiHash());
},
select: function(event) {
- var uiHash = {
- value: this.value()
- };
- this._trigger("select", event, uiHash);
+ this._trigger("select", event, this._uiHash());
},
_closeOthers: function(event){
$('.'+ this.widgetBaseClass
+'.ui-state-active').not(this.newelement).each(function(){