diff --git a/src/index.html b/src/index.html index f4fa85f..1864f03 100644 --- a/src/index.html +++ b/src/index.html @@ -93,6 +93,8 @@

+
diff --git a/src/web/presetcontroller.mjs b/src/web/presetcontroller.mjs index f60d1b0..ae7ebbd 100644 --- a/src/web/presetcontroller.mjs +++ b/src/web/presetcontroller.mjs @@ -50,6 +50,8 @@ class PresetController { // Tell the SettingsController to update const config = this.#model.getPreset().config(); + const description = this.#model.getPreset().description(); + this.#view.displayDescription(description); this.#settingsController.updateSettings(config); }; } diff --git a/src/web/presetview.mjs b/src/web/presetview.mjs index fbef979..f4e0f6a 100644 --- a/src/web/presetview.mjs +++ b/src/web/presetview.mjs @@ -16,13 +16,21 @@ class PresetView { */ #presetHeader; + /** + * @private presetDescription - reference to the HTML div that will contain + * the description of the current preset + */ + #presetDescription; + /** * @constructor */ constructor() { this.#presetGroup = $('#preset-btn-group'); this.#presetHeader = $('#currentPreset'); + this.#presetDescription = $('#presetDescription'); + this.#presetDescription.hide(); log.trace('PresetView constructor executed'); }; @@ -47,6 +55,16 @@ class PresetView { this.#presetGroup.append(button); }); }; + + /** + * This function shows the description of the currently selected preset + * + * @param {string} description - the description of the preset + */ + displayDescription(description) { + this.#presetDescription.html(description).show(); + } + /** * This is the function that is called * when one of the preset buttons is clicked