File tree Expand file tree Collapse file tree 1 file changed +1
-25
lines changed
src/BootstrapBlazor/wwwroot/modules Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change 1- import { isElement , registerBootstrapBlazorModule } from "./utility.js"
2- import EventHandler from "./event-handler.js"
1+ import { isElement } from "./utility.js"
32
43export async function toggle ( options ) {
5- registerBootstrapBlazorModule ( "FullScreen" , null , ( ) => {
6- EventHandler . on ( document , "fullscreenchange" , ( ) => {
7- if ( document . fullscreenElement === null ) {
8- [ ...document . querySelectorAll ( '.bb-fs-open' ) ] . forEach ( el => {
9- el . classList . remove ( 'bb-fs-open' ) ;
10- } )
11- }
12- } ) ;
13- } )
144 let el = null ;
155 options = options || { } ;
166 if ( options . id ) {
@@ -35,24 +25,10 @@ export async function toggle(options) {
3525
3626const enterFullscreen = async el => {
3727 await el . requestFullscreen ( ) ;
38-
39- updateFullscreenState ( el ) ;
4028}
4129
4230const exitFullscreen = async el => {
4331 await document . exitFullscreen ( )
44-
45- updateFullscreenState ( el ) ;
46- }
47-
48- const updateFullscreenState = el => {
49- if ( isFullscreen ( ) ) {
50- el . classList . add ( 'bb-fs-open' )
51- }
52- else {
53- el . classList . remove ( 'bb-fs-open' ) ;
54- document . documentElement . classList . remove ( 'bb-fs-open' ) ;
55- }
5632}
5733
5834const isFullscreen = ( ) => {
You can’t perform that action at this time.
0 commit comments