From d296c3dbaa4354f5b4f6ad5f8cbe87c21c5edf48 Mon Sep 17 00:00:00 2001 From: Snuffleupagus Date: Wed, 6 Feb 2013 16:58:32 +0100 Subject: [PATCH] Add 'pagemode' URL parameter - comments addressed --- web/viewer.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/viewer.js b/web/viewer.js index 184528c43..89060f522 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1492,6 +1492,18 @@ var PDFView = { this.page = pageNumber; // simple page } } + if ('pagemode' in params) { + var toggle = document.getElementById('sidebarToggle'); + if (params.pagemode === 'thumbs' || params.pagemode === 'bookmarks') { + if (!this.sidebarOpen) { + toggle.click(); + } + this.switchSidebarView(params.pagemode === 'thumbs' ? + 'thumbs' : 'outline'); + } else if (params.pagemode === 'none' && this.sidebarOpen) { + toggle.click(); + } + } } else if (/^\d+$/.test(hash)) // page number this.page = hash; else // named destination