add a changeId method to the OptionManager

This commit is contained in:
Damien Churchill 2009-06-17 06:36:55 +00:00
parent 7dfce33065
commit 7bc81fbaf9
2 changed files with 14 additions and 2 deletions

View file

@ -43,7 +43,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
this.changed = {};
this.defaults = config['defaults'] || {};
this.options = {};
this.currentId = null;
this.addEvents({
'add': true,
@ -86,6 +86,18 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
}
},
/**
* Changes bound fields to use the specified id.
* @param {String} id
*/
changeId: function(id) {
this.currentId = id;
for (var option in this.defaults) {
if (!this.binds[option]) continue;
this.binds[option].setValue(this.getValue(id, option));
}
},
/**
* Returns the changed values for a specified id.
* @param {String} id

File diff suppressed because one or more lines are too long