diff options
author | Chris Porter <slug@qwebirc.org> | 2011-02-19 23:16:22 (GMT) |
---|---|---|
committer | Chris Porter <slug@qwebirc.org> | 2011-02-19 23:16:22 (GMT) |
commit | 69d40f107f1ec15436e4dce047e75bda05c80bd4 (patch) | |
tree | 21b2a416c1007dc15d09045e11682846bd797add | |
parent | efaabef3ae69cddd07b71b7c342c1b461e942f3e (diff) |
Split fetching and applying of options.
-rw-r--r-- | js/ui/panes/options.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/js/ui/panes/options.js b/js/ui/panes/options.js index 2d92baf..512c0fd 100644 --- a/js/ui/panes/options.js +++ b/js/ui/panes/options.js @@ -20,7 +20,7 @@ qwebirc.config.DEFAULT_OPTIONS = [ return [false, false]; /* [disabled, default_value] */ return [true]; }, - get: function(value, ui) { + applyChanges: function(value, ui) { if(ui.setBeepOnMention) ui.setBeepOnMention(value); } @@ -45,7 +45,7 @@ qwebirc.config.DEFAULT_OPTIONS = [ [11, "STYLE_HUE", "Adjust user interface hue", function() { return {class_: qwebirc.config.HueOption, default_: 210}; }, { - get: function(value, ui) { + applyChanges: function(value, ui) { ui.setModifiableStylesheetValues(value, 0, 0); } }], @@ -86,9 +86,8 @@ qwebirc.config.Input = new Class({ render: function() { this.event("render", this.mainElement); }, - get: function(value) { - this.event("get", [value, this.parentObject.optionObject.ui]); - return value; + applyChanges: function() { + this.event("applyChanges", [this.get(), this.parentObject.optionObject.ui]); }, event: function(name, x) { if(!$defined(this.option.extras)) @@ -115,7 +114,7 @@ qwebirc.config.TextInput = new Class({ this.parent(); }, get: function() { - return this.parent(this.mainElement.value); + return this.mainElement.value; } }); @@ -142,7 +141,7 @@ qwebirc.config.HueInput = new Class({ slider.addEvent("change", function(step) { this.value = step; - this.get(); + this.applyChanges(); }.bind(this)); this.mainElement = i; @@ -152,11 +151,11 @@ qwebirc.config.HueInput = new Class({ this.parent(); }, get: function() { - return this.parent(this.value); + return this.value; }, cancel: function() { this.value = this.startValue; - this.get(); + this.applyChanges(); } }); @@ -172,7 +171,7 @@ qwebirc.config.CheckInput = new Class({ this.parent(); }, get: function() { - return this.parent(this.mainElement.checked); + return this.mainElement.checked; } }); @@ -201,7 +200,7 @@ qwebirc.config.RadioInput = new Class({ var x = this.elements[i]; if(x.checked) { this.option.position = i; - return this.parent(this.option.options[i][1]); + return this.option.options[i][1]; } } } @@ -399,6 +398,9 @@ qwebirc.ui.OptionsPane = new Class({ var box = x[1]; this.optionObject.setValue(option, box.get()); }.bind(this)); + this.boxList.forEach(function(x) { + x[1].applyChanges(); + }.bind(this)); this.optionObject.flush(); }, cancel: function() { |