mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Change button to plus and minus to inc/dec position (#17194)
This commit is contained in:
parent
d56273ec25
commit
000288aecb
@ -1,14 +1,14 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||||
import {
|
import {
|
||||||
mdiArrowDown,
|
|
||||||
mdiArrowUp,
|
|
||||||
mdiContentCopy,
|
mdiContentCopy,
|
||||||
mdiContentCut,
|
mdiContentCut,
|
||||||
mdiContentDuplicate,
|
mdiContentDuplicate,
|
||||||
mdiDelete,
|
mdiDelete,
|
||||||
mdiDotsVertical,
|
mdiDotsVertical,
|
||||||
mdiFileMoveOutline,
|
mdiFileMoveOutline,
|
||||||
|
mdiMinus,
|
||||||
|
mdiPlus,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import deepClone from "deep-clone-simple";
|
import deepClone from "deep-clone-simple";
|
||||||
import {
|
import {
|
||||||
@ -96,14 +96,12 @@ export class HuiCardOptions extends LitElement {
|
|||||||
? html`
|
? html`
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
.label=${this.hass!.localize(
|
.label=${this.hass!.localize(
|
||||||
"ui.panel.lovelace.editor.edit_card.move_down"
|
"ui.panel.lovelace.editor.edit_card.decrease_position"
|
||||||
)}
|
)}
|
||||||
.path=${mdiArrowDown}
|
.path=${mdiMinus}
|
||||||
class="move-arrow"
|
class="move-arrow"
|
||||||
@click=${this._cardDown}
|
@click=${this._decreaseCardPosiion}
|
||||||
.disabled=${this.lovelace!.config.views[this.path![0]]
|
?disabled=${this.path![1] === 0}
|
||||||
.cards!.length ===
|
|
||||||
this.path![1] + 1}
|
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
@click=${this._changeCardPosition}
|
@click=${this._changeCardPosition}
|
||||||
@ -115,12 +113,14 @@ export class HuiCardOptions extends LitElement {
|
|||||||
</ha-icon-button>
|
</ha-icon-button>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
.label=${this.hass!.localize(
|
.label=${this.hass!.localize(
|
||||||
"ui.panel.lovelace.editor.edit_card.move_up"
|
"ui.panel.lovelace.editor.edit_card.increase_position"
|
||||||
)}
|
)}
|
||||||
.path=${mdiArrowUp}
|
.path=${mdiPlus}
|
||||||
class="move-arrow"
|
class="move-arrow"
|
||||||
@click=${this._cardUp}
|
@click=${this._increaseCardPosition}
|
||||||
?disabled=${this.path![1] === 0}
|
.disabled=${this.lovelace!.config.views[this.path![0]]
|
||||||
|
.cards!.length ===
|
||||||
|
this.path![1] + 1}
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
@ -291,7 +291,7 @@ export class HuiCardOptions extends LitElement {
|
|||||||
this._clipboard = deepClone(cardConfig);
|
this._clipboard = deepClone(cardConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _cardUp(): void {
|
private _decreaseCardPosiion(): void {
|
||||||
const lovelace = this.lovelace!;
|
const lovelace = this.lovelace!;
|
||||||
const path = this.path!;
|
const path = this.path!;
|
||||||
lovelace.saveConfig(
|
lovelace.saveConfig(
|
||||||
@ -299,7 +299,7 @@ export class HuiCardOptions extends LitElement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _cardDown(): void {
|
private _increaseCardPosition(): void {
|
||||||
const lovelace = this.lovelace!;
|
const lovelace = this.lovelace!;
|
||||||
const path = this.path!;
|
const path = this.path!;
|
||||||
lovelace.saveConfig(
|
lovelace.saveConfig(
|
||||||
|
@ -4571,11 +4571,11 @@
|
|||||||
"cut": "Cut",
|
"cut": "Cut",
|
||||||
"duplicate": "Duplicate",
|
"duplicate": "Duplicate",
|
||||||
"move": "Move to view",
|
"move": "Move to view",
|
||||||
"move_up": "Move card up",
|
|
||||||
"move_down": "Move card down",
|
|
||||||
"move_before": "Move card before",
|
"move_before": "Move card before",
|
||||||
"move_after": "Move card after",
|
"move_after": "Move card after",
|
||||||
"change_position": "Change card position",
|
"change_position": "Change card position",
|
||||||
|
"decrease_position": "Decrease card position",
|
||||||
|
"increase_position": "Increase card position",
|
||||||
"options": "More options",
|
"options": "More options",
|
||||||
"search_cards": "Search cards"
|
"search_cards": "Search cards"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user