Add 'pagemode' URL parameter - comments addressed

This commit is contained in:
Snuffleupagus 2013-02-06 16:58:32 +01:00
parent ef1be8ee33
commit d296c3dbaa

View File

@ -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