From 8a51a5e97859c570b5840c9c5691157087d94e33 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 8 Apr 2009 20:35:35 +0000 Subject: [PATCH] make the close button close the window --- deluge/ui/web/js/deluge-preferences.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/deluge/ui/web/js/deluge-preferences.js b/deluge/ui/web/js/deluge-preferences.js index 7f7352630..cbd1e5595 100644 --- a/deluge/ui/web/js/deluge-preferences.js +++ b/deluge/ui/web/js/deluge-preferences.js @@ -35,7 +35,9 @@ Copyright: this.resizable = false; this.title = _('Preferences'); this.buttons = [{ - text: _('Close') + text: _('Close'), + handler: this.onCloseButtonClick, + scope: this },{ text: _('Apply') },{ @@ -81,6 +83,10 @@ Copyright: this.on('show', this.onShow.bindWithEvent(this)); }, + onCloseButtonClick: function() { + this.hide(); + }, + addPage: function(name, page) { var store = this.categoriesGrid.getStore(); store.loadData([[name]], true); @@ -97,7 +103,9 @@ Copyright: }, onShow: function() { - + if (!this.categoriesGrid.getSelectionModel().hasSelection()) { + this.categoriesGrid.getSelectionModel().selectFirstRow(); + } } });