Move code to the right place and give it a better style.
Highlight the background on hover.
This commit is contained in:
parent
6bb14af71c
commit
14eae7cb9f
3 changed files with 29 additions and 44 deletions
|
@ -170,6 +170,7 @@ var PDFView = {
|
|||
currentScale: kUnknownScale,
|
||||
currentScaleValue: null,
|
||||
initialBookmark: document.location.hash.substring(1),
|
||||
pinState: false,
|
||||
|
||||
setScale: function pdfViewSetScale(val, resetAutoSettings) {
|
||||
if (val == this.currentScale)
|
||||
|
@ -572,6 +573,24 @@ var PDFView = {
|
|||
break;
|
||||
}
|
||||
},
|
||||
|
||||
pinSidebar: function pdfViewPinSidebar() {
|
||||
|
||||
var sidebar = document.getElementById("sidebar");
|
||||
var pinIcon = document.getElementById("pinIcon");
|
||||
|
||||
sidebar.className = sidebar.className.replace( /(?:^|\s)released(?!\S)/ , '' );
|
||||
sidebar.className = sidebar.className.replace( /(?:^|\s)pinned(?!\S)/ , '' );
|
||||
pinIcon.className = pinIcon.className.replace( /(?:^|\s)released(?!\S)/ , '' );
|
||||
pinIcon.className = pinIcon.className.replace( /(?:^|\s)pinned(?!\S)/ , '' );
|
||||
|
||||
var newClass = this.pinState ? " pinned" : " released";
|
||||
|
||||
sidebar.className += newClass;
|
||||
pinIcon.className += newClass;
|
||||
|
||||
this.pinState = !this.pinState;
|
||||
},
|
||||
|
||||
getVisiblePages: function pdfViewGetVisiblePages() {
|
||||
var pages = this.pages;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue