make the close button close the window

This commit is contained in:
Damien Churchill 2009-04-08 20:35:35 +00:00
parent 62375c7109
commit 8a51a5e978
1 changed files with 10 additions and 2 deletions

View File

@ -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();
}
}
});