Skip to content

Commit 4dfff68

Browse files
committed
fix: update fullscreen state icon
1 parent cf8e25c commit 4dfff68

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/BootstrapBlazor/wwwroot/modules/fullscreen.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function toggle(options) {
1414

1515
if (el !== null) {
1616
if (isFullscreen()) {
17-
await document.exitFullscreen()
17+
await exitFullscreen(el);
1818
}
1919
else {
2020
await enterFullscreen(el);
@@ -25,6 +25,16 @@ export async function toggle(options) {
2525
const enterFullscreen = async el => {
2626
await el.requestFullscreen();
2727

28+
updateFullscreenState(el);
29+
}
30+
31+
const exitFullscreen = async el => {
32+
await document.exitFullscreen()
33+
34+
updateFullscreenState(el);
35+
}
36+
37+
const updateFullscreenState = el => {
2838
if (!isFullscreen()) {
2939
el.classList.remove('bb-fs-open');
3040
document.documentElement.classList.remove('bb-fs-open');

0 commit comments

Comments
 (0)