-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update AppItem to support slideshow
- Loading branch information
1 parent
3e6c10e
commit 69ce1fc
Showing
4 changed files
with
15 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,6 @@ | ||
import { getGridItemDomElementClassName } from '../../modules/getGridItemDomElementClassName.js' | ||
import { getGridItemElement } from './getGridItemElement.js' | ||
|
||
export const isElementFullscreen = (itemId) => { | ||
const fullscreenElement = | ||
document.fullscreenElement || document.webkitFullscreenElement | ||
|
||
return fullscreenElement?.classList.contains( | ||
getGridItemDomElementClassName(itemId) | ||
) | ||
} | ||
|
||
export const isFullscreenSupported = (itemId) => { | ||
const el = getGridItemElement(itemId) | ||
return !!(el?.requestFullscreen || el?.webkitRequestFullscreen) | ||
} | ||
|
||
export const onToggleFullscreen = (itemId) => { | ||
if (!isElementFullscreen(itemId)) { | ||
const el = getGridItemElement(itemId) | ||
if (el?.requestFullscreen) { | ||
el.requestFullscreen() | ||
} else if (el?.webkitRequestFullscreen) { | ||
el.webkitRequestFullscreen() | ||
} | ||
} else { | ||
document.exitFullscreen | ||
? document.exitFullscreen() | ||
: document.webkitExitFullscreen() | ||
} | ||
} |