Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate add/edit resources dialog to @material/web #21933

Merged
merged 21 commits into from
Sep 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b932a70
Remove dashboard resources options from advanced mode
wendevlin Sep 5, 2024
5bbb6d3
Add ha-dialog-new, use it for dashboard resources
wendevlin Sep 5, 2024
7865137
Merge branch 'dev' of github.com:home-assistant/frontend into add-edi…
wendevlin Sep 9, 2024
c0df09d
Add ha-dialog-new shake; Move resources delete to table
wendevlin Sep 9, 2024
b852100
Improve ha-dialog-new, resource-detail
wendevlin Sep 10, 2024
a4cc65d
Merge branch 'dev' of github.com:home-assistant/frontend into add-edi…
wendevlin Sep 10, 2024
2d81667
Rename ha-dialog-new to ha-md-dialog
wendevlin Sep 11, 2024
c65d22a
Update src/panels/config/lovelace/resources/dialog-lovelace-resource-…
wendevlin Sep 11, 2024
e6b2010
Add ha-md-dialog polyfill
wendevlin Sep 12, 2024
a07a2a0
Fix ha-md-dialog for iOS 12
wendevlin Sep 12, 2024
b87cbdf
Merge branch 'dev' of github.com:home-assistant/frontend into add-edi…
wendevlin Sep 13, 2024
e46ff38
Fix ha-md-dialog polyfill loading
wendevlin Sep 13, 2024
0cdda82
Fix ha-md-dialog open prop
wendevlin Sep 13, 2024
d040a71
Fix ha-md-dialog legacy loading
wendevlin Sep 13, 2024
7e9cc39
Merge branch 'dev' of github.com:home-assistant/frontend into add-edi…
wendevlin Sep 13, 2024
1b2bd99
Improve ha-md-dialog legacy loading
wendevlin Sep 13, 2024
67379da
Merge branch 'dev' of github.com:home-assistant/frontend into add-edi…
wendevlin Sep 16, 2024
5df1580
Fix multiple polyfill loads in ha-md-dialog
wendevlin Sep 16, 2024
69e85f2
Fix polyfill handleOpen in ha-md-dialog
wendevlin Sep 16, 2024
2678c8e
Improve polyfill handleOpen in ha-md-dialog
wendevlin Sep 16, 2024
82c2144
Improve polyfill handleOpen ordering in ha-md-dialog
wendevlin Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions src/components/ha-md-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,22 @@ export class HaMdDialog extends MdDialog {
// prevent open in older browsers and wait for polyfill to load
private async _handleOpen(openEvent: Event) {
openEvent.preventDefault();
if (!this._polyfillDialogRegistered) {
this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");
const dialog = this.shadowRoot?.querySelector(
"dialog"
) as HTMLDialogElement;

const dialogPolyfill = await DIALOG_POLYFILL;
dialogPolyfill.default.registerDialog(dialog);
this.removeEventListener("open", this._handleOpen);

this._polyfillDialogRegistered = true;
this.show();

if (this._polyfillDialogRegistered) {
return;
}

this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");
const dialog = this.shadowRoot?.querySelector(
"dialog"
) as HTMLDialogElement;

const dialogPolyfill = await DIALOG_POLYFILL;
dialogPolyfill.default.registerDialog(dialog);
this.removeEventListener("open", this._handleOpen);

this._polyfillDialogRegistered = true;
wendevlin marked this conversation as resolved.
Show resolved Hide resolved
this.show();
}

private async _loadPolyfillStylesheet(href) {
Expand Down
Loading