[FIX] website_slides: fullscreen and previous/next

This solves 2 issues:

1) When the slide is set to fullscreen, on Firefox, the image was
stretched and the aspect ratio not respected. This is the default
behavior of Firefox for a canvas. By choosing the parentNode instead (a
div tag which only contains the canvas), the aspect ratio is respected.

2) Arrow key up/down has now the same behavior than arrow key
left/right.

opw-650174
This commit is contained in:
Nicolas Martinelli
2015-09-28 15:29:06 +02:00
parent 9dcb05b148
commit a4bc3c23aa
2 changed files with 3 additions and 3 deletions
@@ -146,7 +146,7 @@ var PDFSlidesViewer = (function(){
}
PDFSlidesViewer.prototype.toggleFullScreen = function(){
var el = this.canvas;
var el = this.canvas.parentNode;
var isFullscreenAvailable = document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled || false;
if(isFullscreenAvailable){ // Full screen supported
@@ -129,10 +129,10 @@ $(document).ready(function () {
// switching slide with keyboard
$(document).keydown(function (ev) {
if (ev.keyCode === 37) {
if (ev.keyCode === 37 || ev.keyCode === 38) {
embedded_viewer.previous();
}
if (ev.keyCode === 39) {
if (ev.keyCode === 39 || ev.keyCode === 40) {
embedded_viewer.next();
}
});