Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Add a FullScreen option to close Fancybox when exit fullscreen mode. #1502

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion dist/jquery.fancybox.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@

fullScreen : {
autoStart : false,
closeOnExit: false
},

touch : {
Expand Down Expand Up @@ -4455,7 +4456,11 @@
instance.update( true, true, 0 );
}

});
if( instance.FullScreen && !instance.FullScreen.isFullscreen() && instance.opts.fullScreen.closeOnExit === true ) {
instance.close();
}

});

}(document, window.jQuery));

Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.fancybox.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@

fullScreen : {
autoStart : false,
closeOnExit: false
},

touch : {
Expand Down
6 changes: 5 additions & 1 deletion src/js/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@
instance.update( true, true, 0 );
}

});
if( instance.FullScreen && !instance.FullScreen.isFullscreen() && instance.opts.fullScreen.closeOnExit === true ) {
instance.close();
}

});

}(document, window.jQuery));