Skip to content

Commit f44cca0

Browse files
committed
Add url parameter for setting showToolbar option
1 parent ffc73a5 commit f44cca0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

BookReaderDemo/IADemoBr.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ const initializeBookReader = (brManifest) => {
4545
flipDelay: urlParams.flipDelay || 5000
4646
};
4747

48+
function getFromUrl(name, def) {
49+
if (urlParams.has(name)) {
50+
return urlParams.get(name);
51+
} else {
52+
return def;
53+
}
54+
}
55+
4856
const options = {
4957
el: '#BookReader',
5058
/* Url plugin - IA uses History mode for URL */
@@ -62,7 +70,7 @@ const initializeBookReader = (brManifest) => {
6270
initialSearchTerm: searchTerm ? searchTerm : '',
6371
// leaving this option commented out bc we change given user agent on archive.org
6472
// onePage: { autofit: <?=json_encode($this->ios ? 'width' : 'auto')?> },
65-
showToolbar: false,
73+
showToolbar: getFromUrl('options.showToolbar', 'false') === 'true',
6674
/* Multiple volumes */
6775
// To show multiple volumes:
6876
enableMultipleBooks: false, // turn this on

0 commit comments

Comments
 (0)