From b6e3ad033f98bf75a0d03021907103ed313ab475 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 24 Apr 2017 11:29:37 -0400 Subject: [PATCH] LP#1685840: Google Books Preview: responsive sizing Use the viewport's actual height and width to display the book preview, rather than hard-coding 600px x 800px. On a very wide screen, the book will be centred; on a small screen such as a mobile device, the book will not scroll indiscriminately off to the side, but instead stays within the bounds of the viewport. Signed-off-by: Dan Scott Signed-off-by: Ben Shum Signed-off-by: Galen Charlton --- Open-ILS/src/templates/opac/parts/ac_google_books.tt2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 b/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 index c5a13031ff..5632395bdb 100644 --- a/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 +++ b/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 @@ -71,8 +71,8 @@ if (GBPreviewPane === null || typeof GBPreviewPane.loaded === 'undefined' || GBPreviewPane.loaded === 'false') { GBPreviewPane = document.createElement('div'); GBPreviewPane.id = 'rdetail_preview_div'; - GBPreviewPane.style.height = '800px'; - GBPreviewPane.style.width = '600px'; + GBPreviewPane.style.height = document.documentElement.clientHeight + 'px'; + GBPreviewPane.style.width = document.documentElement.clientWidth + 'px'; GBPreviewPane.style.display = 'block'; var GBClear = document.createElement('div'); GBClear.style.padding = '1em'; -- 2.43.2