From 88930f5a3dab00fc06518ca7705329bd3d38d964 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@gmail.com> Date: Thu, 7 May 2020 15:58:16 +0200 Subject: [PATCH] add an option to display units for the options textbox --- src/gui/options.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/options.js b/src/gui/options.js index 4c1996f159f..ac475a380e2 100644 --- a/src/gui/options.js +++ b/src/gui/options.js @@ -68,10 +68,14 @@ App.UI.OptionsGroup = (function() { } /** + * @param {string} [unit] * @returns {Option} */ - showTextBox() { + showTextBox(unit) { this.textbox = true; + if (unit) { + this.unit = unit; + } return this; } @@ -256,6 +260,9 @@ App.UI.OptionsGroup = (function() { textbox.classList.add("number"); } buttonGroup.append(textbox); + if (option.unit) { + buttonGroup.append(" ", option.unit); + } } if (option.comment) { const comment = document.createElement("span"); @@ -264,7 +271,6 @@ App.UI.OptionsGroup = (function() { buttonGroup.append(comment); } container.append(buttonGroup); - } return container; -- GitLab