mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Add collapse/expand all for automations (#26695)
This commit is contained in:
@@ -31,6 +31,7 @@ import type { HomeAssistant } from "../../../types";
|
||||
import { documentationUrl } from "../../../util/documentation-url";
|
||||
import { showToast } from "../../../util/toast";
|
||||
import "../automation/action/ha-automation-action";
|
||||
import type HaAutomationAction from "../automation/action/ha-automation-action";
|
||||
import "../automation/ha-automation-sidebar";
|
||||
import { showPasteReplaceDialog } from "../automation/paste-replace-dialog/show-dialog-paste-replace";
|
||||
import { saveFabStyles } from "../automation/styles";
|
||||
@@ -460,6 +461,24 @@ export class HaManualScriptEditor extends LitElement {
|
||||
fireEvent(this, "save-script");
|
||||
}
|
||||
|
||||
private _getCollapsableElements() {
|
||||
return this.shadowRoot!.querySelectorAll<
|
||||
HaAutomationAction | HaScriptFields
|
||||
>("ha-automation-action, ha-script-fields");
|
||||
}
|
||||
|
||||
public expandAll() {
|
||||
this._getCollapsableElements().forEach((element) => {
|
||||
element.expandAll();
|
||||
});
|
||||
}
|
||||
|
||||
public collapseAll() {
|
||||
this._getCollapsableElements().forEach((element) => {
|
||||
element.collapseAll();
|
||||
});
|
||||
}
|
||||
|
||||
static get styles(): CSSResultGroup {
|
||||
return [
|
||||
saveFabStyles,
|
||||
|
||||
Reference in New Issue
Block a user