Browse Source

add .get() and .set() to twisterOptions

readme-update
Simon Grim 8 years ago
parent
commit
c14103ae3c
  1. 14
      js/options.js

14
js/options.js

@ -316,6 +316,20 @@ twisterOptions.prototype.add = function (option) {
this[option.name] = new twisterOption(option); this[option.name] = new twisterOption(option);
}; };
twisterOptions.prototype.get = function (optionName) {
if (optionName && typeof this[optionName] !== 'undefined')
return this[optionName].val;
else
console.warn('option \'' + optionName + '\' does not exist');
};
twisterOptions.prototype.set = function (optionName, val) {
if (optionName && typeof this[optionName] !== 'undefined')
this[optionName].set(val);
else
console.warn('option \'' + optionName + '\' does not exist');
};
twisterOptions.prototype.initControls = function () { twisterOptions.prototype.initControls = function () {
var elem; var elem;

Loading…
Cancel
Save