diff options
author | setnes <kristopher@setnes.net> | 2015-06-07 00:06:07 +0300 |
---|---|---|
committer | setnes <kristopher@setnes.net> | 2015-06-07 00:06:07 +0300 |
commit | b376842573b12e71c6400a5262a0ce2988eb3ef8 (patch) | |
tree | 9e80f65ca547044c47510485fe3345966a2c5dfe /js | |
parent | 8c0bcfb7e647d595e6b6fbd5da25520dadd30bcf (diff) |
Use screen size instead of window size to request previews.
Fixes #166
The images created will work if the user goes into fullscreen mode or
maximizes the browser window while the slideshow is playing.
Diffstat (limited to 'js')
-rw-r--r-- | js/galleryfileaction.js | 4 | ||||
-rw-r--r-- | js/galleryutility.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/js/galleryfileaction.js b/js/galleryfileaction.js index 79122a87..30a71a81 100644 --- a/js/galleryfileaction.js +++ b/js/galleryfileaction.js @@ -59,8 +59,8 @@ var galleryFileAction = { var start = 0; var images = []; var dir = context.dir + '/'; - var width = Math.floor($(window).width() * window.devicePixelRatio); - var height = Math.floor($(window).height() * window.devicePixelRatio); + var width = Math.floor(screen.width * window.devicePixelRatio); + var height = Math.floor(screen.height * window.devicePixelRatio); /* Find value of longest edge. */ var longEdge = Math.max( width, height ); diff --git a/js/galleryutility.js b/js/galleryutility.js index c0a5faf8..8371d9e8 100644 --- a/js/galleryutility.js +++ b/js/galleryutility.js @@ -98,8 +98,8 @@ * @return {string} */ getPreviewUrl: function (fileId, etag) { - var width = $(window).width() * window.devicePixelRatio; - var height = $(window).height() * window.devicePixelRatio; + var width = Math.floor(screen.width * window.devicePixelRatio); + var height = Math.floor(screen.height * window.devicePixelRatio); /* Find value of longest edge. */ var longEdge = Math.max( width, height ); |