Update cookcli-recipe-strategy.js
This commit is contained in:
parent
0d292ee14d
commit
ac035b3a97
|
|
@ -246,6 +246,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
|
* Barre de navigation flottante en bas de l'écran. Les boutons ont une
|
||||||
* largeur fixe (et non flex: 1) : un seul bouton fait la même taille que
|
* largeur fixe (et non flex: 1) : un seul bouton fait la même taille que
|
||||||
|
|
@ -465,20 +490,7 @@ class CookCliRecipeViewStrategy extends HTMLElement {
|
||||||
this._navButton(config.step_entity, tabIndex + 1, "Suivant", "mdi:arrow-right", true)
|
this._navButton(config.step_entity, tabIndex + 1, "Suivant", "mdi:arrow-right", true)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
navButtons.push({
|
navButtons.push(this._navSpacer());
|
||||||
type: "heading",
|
|
||||||
card_mod: {
|
|
||||||
style: `
|
|
||||||
ha-card {
|
|
||||||
width: ${this.NAV_BUTTON_WIDTH} !important;
|
|
||||||
}`
|
|
||||||
}
|
|
||||||
});
|
|
||||||
/*navButtons.push({
|
|
||||||
type: "markdown",
|
|
||||||
content: " ",
|
|
||||||
text_only: true
|
|
||||||
});*/
|
|
||||||
}
|
}
|
||||||
cards.push(this._floatingNav(navButtons));
|
cards.push(this._floatingNav(navButtons));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue