store the other menu item when we encounter it looping over for later

This commit is contained in:
Damien Churchill 2010-03-30 14:31:36 +01:00
parent 7c5dacba5f
commit 183064f857

View File

@ -251,6 +251,7 @@ Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
// set the new value // set the new value
value = (value == 0) ? -1 : value; value = (value == 0) ? -1 : value;
var other = null;
// uncheck all items // uncheck all items
this.items.each(function(item) { this.items.each(function(item) {
if (item.setChecked) { if (item.setChecked) {
@ -263,14 +264,15 @@ Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
} }
item.resumeEvents(); item.resumeEvents();
} }
if (item.value == 'other') other = item;
}); });
if (beenSet) return; if (beenSet) return;
var item = this.items.get('other'); other.suspendEvents();
item.suspendEvents(); other.setChecked(true);
item.setChecked(true); other.resumeEvents();
item.resumeEvents();
} }
}); });