Skip to content

Commit 6c25694

Browse files
committed
fix(demo): improve dark theme support in demos
1 parent 27d80aa commit 6c25694

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/java/com/flowingcode/vaadin/addons/extendedlogin/ExtendedLoginOverlayDemo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package com.flowingcode.vaadin.addons.extendedlogin;
2121

2222
import com.flowingcode.vaadin.addons.demo.DemoSource;
23+
import com.flowingcode.vaadin.addons.demo.TabbedDemo;
2324
import com.flowingcode.vaadin.addons.demo.ThemeChangeObserver;
2425
import com.vaadin.flow.component.html.Div;
2526
import com.vaadin.flow.component.html.IFrame;
@@ -45,8 +46,7 @@ public ExtendedLoginOverlayDemo() {
4546

4647
@Override
4748
public void onThemeChange(String themeName) {
48-
iframe.getElement().executeJs(
49-
"this.contentWindow.document.querySelector('html').setAttribute('theme', $0)", themeName);
49+
TabbedDemo.applyTheme(iframe.getElement(), themeName);
5050
}
5151

5252
}

src/test/java/com/flowingcode/vaadin/addons/extendedlogin/LoginLayoutDemo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package com.flowingcode.vaadin.addons.extendedlogin;
2121

2222
import com.flowingcode.vaadin.addons.demo.DemoSource;
23+
import com.flowingcode.vaadin.addons.demo.TabbedDemo;
2324
import com.flowingcode.vaadin.addons.demo.ThemeChangeObserver;
2425
import com.vaadin.flow.component.html.Div;
2526
import com.vaadin.flow.component.html.IFrame;
@@ -46,8 +47,7 @@ public LoginLayoutDemo() {
4647

4748
@Override
4849
public void onThemeChange(String themeName) {
49-
iframe.getElement().executeJs(
50-
"this.contentWindow.document.querySelector('html').setAttribute('theme', $0)", themeName);
50+
TabbedDemo.applyTheme(iframe.getElement(), themeName);
5151
}
5252

5353
}

0 commit comments

Comments
 (0)