web: few sidebar fixes

This commit is contained in:
Damien Churchill 2011-11-21 23:05:02 +00:00
parent e3e20aa14f
commit 1837d833c2
2 changed files with 6 additions and 8 deletions

View File

@ -174,7 +174,9 @@ Ext.define('Deluge.FilterPanel', {
if (filters[record.getId()]) return; if (filters[record.getId()]) return;
var r = sm.getLastSelected(); var r = sm.getLastSelected();
store.remove(record); store.remove(record);
if (r.id == record.id) { if (r === undefined)
return;
if (r.getId() == record.getId()) {
sm.select(0); sm.select(0);
} }
}, this); }, this);

View File

@ -90,13 +90,9 @@ Ext.define('Deluge.Sidebar', {
deluge.ui.update(); deluge.ui.update();
} }
Ext.defer(function() { if (!sm.hasSelection() && s.count() > 0) {
panel.doLayout(); sm.select([s.first()]);
}, 100); }
console.log('switching');
//if (!sm.hasSelection() && s.count() > 0) {
// sm.select([s.first()]);
//}
}); });
this.fireEvent('filtercreate', this, panel); this.fireEvent('filtercreate', this, panel);