From c14103ae3c7eb728e2d15ae0c02f7b0b17addef3 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Sun, 11 Sep 2016 17:24:48 +0500 Subject: [PATCH] add .get() and .set() to twisterOptions --- js/options.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/options.js b/js/options.js index b3d034b..e813595 100644 --- a/js/options.js +++ b/js/options.js @@ -316,6 +316,20 @@ twisterOptions.prototype.add = function (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 () { var elem;