[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:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user