.data('optionClasses', selectOptionData[i].classes || '')
.bind("mouseup.selectmenu", function(event) {
if (self._safemouseup && !self._disabled(event.currentTarget) && !self._disabled($( event.currentTarget ).parents( "ul>li." + self.widgetBaseClass + "-group " )) ) {
- var changed = $(this).data('index') != self._selectedIndex();
self.index($(this).data('index'));
self.select(event);
- if (changed) {
- self.change(event);
- }
self.close(event, true);
}
return false;
}
},
- index: function(newValue) {
+ index: function(newIndex) {
if (arguments.length) {
- if (!this._disabled($(this._optionLis[newValue]))) {
- this.element[0].selectedIndex = newValue;
+ if (!this._disabled($(this._optionLis[newIndex])) && newIndex != this._selectedIndex()) {
+ this.element[0].selectedIndex = newIndex;
this._refreshValue();
+ this.change();
} else {
return false;
}
},
value: function(newValue) {
- if (arguments.length) {
+ if (arguments.length && newValue != this.element[0].value) {
this.element[0].value = newValue;
this._refreshValue();
+ this.change();
} else {
return this.element[0].value;
}