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
1 changed files with 6 additions and 4 deletions

View File

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