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 <dscott@laurentian.ca>
Signed-off-by: Ben Shum <ben@evergreener.net>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
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';