From ac035b3a9736d3cf997de74d6dd47fd0e08fdcda Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Fri, 25 Sep 2026 16:43:48 +0200 Subject: [PATCH] Update cookcli-recipe-strategy.js --- .../cookcli/www/cookcli-recipe-strategy.js | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/custom_components/cookcli/www/cookcli-recipe-strategy.js b/custom_components/cookcli/www/cookcli-recipe-strategy.js index 4439272..acf89c1 100644 --- a/custom_components/cookcli/www/cookcli-recipe-strategy.js +++ b/custom_components/cookcli/www/cookcli-recipe-strategy.js @@ -245,6 +245,31 @@ class CookCliRecipeViewStrategy extends HTMLElement { }, }; } + + /** + * Occupe exactement la même place qu'un bouton de navigation, en invisible + * et non cliquable : sert à garder "Précédent" à la même position sur la + * dernière étape que sur les autres, où il partage la barre avec "Suivant". + */ + static _navSpacer() { + return { + type: "button", + show_name: false, + show_icon: false, + card_mod: { + style: ` + :host { + flex: 0 0 ${this.NAV_BUTTON_WIDTH} !important; + width: ${this.NAV_BUTTON_WIDTH} !important; + height: ${this.NAV_BUTTON_WIDTH} !important; + min-width: 0 !important; + visibility: hidden; + pointer-events: none; + } + `, + }, + }; + } /** * Barre de navigation flottante en bas de l'écran. Les boutons ont une @@ -465,20 +490,7 @@ class CookCliRecipeViewStrategy extends HTMLElement { this._navButton(config.step_entity, tabIndex + 1, "Suivant", "mdi:arrow-right", true) ); } else { - navButtons.push({ - type: "heading", - card_mod: { - style: ` - ha-card { - width: ${this.NAV_BUTTON_WIDTH} !important; - }` - } - }); - /*navButtons.push({ - type: "markdown", - content: " ", - text_only: true - });*/ + navButtons.push(this._navSpacer()); } cards.push(this._floatingNav(navButtons)); }