diff --git a/src/gui/options/options.js b/src/gui/options/options.js index b9fc196c8527abfcd9cae5ba5313149ffdff2c09..a70c53a33f3320f59583ce52560a1cada384e497 100644 --- a/src/gui/options/options.js +++ b/src/gui/options/options.js @@ -1,4 +1,11 @@ App.UI.OptionsGroup = (function() { + class Row { + /** + * @param {HTMLDivElement} container + */ + render(container) {} // jshint ignore:line + } + /** * @typedef value * @property {*} value @@ -12,13 +19,14 @@ App.UI.OptionsGroup = (function() { * @property {Function} [callback] */ - class Option { + class Option extends Row { /** * @param {string} description can be SC markup * @param {string} property * @param {object} [object=V] */ constructor(description, property, object = V) { + super(); this.description = description; this.property = property; this.object = object; @@ -298,9 +306,9 @@ App.UI.OptionsGroup = (function() { return class { constructor() { /** - * @type {Array<Option>} + * @type {Array<Row>} */ - this.options = []; + this.rows = []; } /** @@ -319,7 +327,7 @@ App.UI.OptionsGroup = (function() { */ addOption(name, property, object = V) { const option = new Option(name, property, object); - this.options.push(option); + this.rows.push(option); return option; } @@ -329,8 +337,9 @@ App.UI.OptionsGroup = (function() { if (this.doubleColumn) { container.classList.add("double"); } - for (/** @type {Option} */ const option of this.options) { - option.render(container); + + for (/** @type {Row} */ const row of this.rows) { + row.render(container); } return container;