Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fullscreen button of slide and presentation #1072

Open
wants to merge 3 commits into
base: v1
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
2 changes: 1 addition & 1 deletion src/main/webapp/js/presentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var createPresentation = function(contentJqObj) {// eslint-disable-line no-unuse
slidehtml += '<div style="text-align:center">';
slidehtml += '<div class="numbertext"><span class="current">1</span> / ' + slideLength;

slidehtml += '&nbsp;&nbsp;&nbsp;<a onclick="requestFullscreen(\'' + slideId + '\');">';
slidehtml += '&nbsp;&nbsp;&nbsp;<a onclick="window.requestFullscreen(\'' + slideId + '\');">';
slidehtml += '<i class="full fa fa-television fa-2x" aria-hidden="true"></i></a>';

/* いったんPDFダウンロードボタンはコメントアウト
Expand Down
13 changes: 2 additions & 11 deletions src/main/webapp/js/slide.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
var indexMap = {};
var full = false;
var slideCount = 0;

var requestFullscreen = function(id) {// eslint-disable-line no-unused-vars
if (full) {
if (document.fullscreenElement) {
if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
full = false;
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
full = false;
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
full = false;
} else if (document.exitFullscreen) {
document.exitFullscreen();
full = false;
}
} else {
var target = document.getElementById(id);
if (target.requestFullscreen) {
target.requestFullscreen(); // HTML5 Fullscreen API仕様
full = true;
} else if (target.webkitRequestFullscreen) {
target.webkitRequestFullscreen(); //Chrome15+, Safari5.1+, Opera15+
full = true;
} else if (target.mozRequestFullScreen) {
target.mozRequestFullScreen(); //FF10+
full = true;
} else if (target.msRequestFullscreen) {
target.msRequestFullscreen(); //IE11+
full = true;
} else {
$.notify('Fullscreen view is not supported.', 'warn');
return;
Expand Down Expand Up @@ -84,7 +75,7 @@ var showSlide = function(parent) {// eslint-disable-line no-unused-vars
slidehtml += '<a class="next" onclick="plusSlides(1, \'' + slideId + '\')">next &#10095;</a>';
slidehtml += '<div style="text-align:center">';
slidehtml += '<div class="numbertext"><span class="current">1</span> / ' + data.files.length;
slidehtml += '&nbsp;&nbsp;&nbsp;<a onclick="requestFullscreen(\'' + slideId + '\');">';
slidehtml += '&nbsp;&nbsp;&nbsp;<a onclick="window.requestFullscreen(\'' + slideId + '\');">';
slidehtml += '<i class="full fa fa-television fa-2x" aria-hidden="true"></i></a></div>';
if (data.files.length < 60) {
slidehtml += '<div class="dotArea">';
Expand Down