Got rid of the "released" class and made the pin icon depend on the sidebar state.
This commit is contained in:
parent
8a22a43cf3
commit
c24684b8e9
3 changed files with 8 additions and 28 deletions
|
@ -168,7 +168,6 @@ var PDFView = {
|
|||
currentScale: kUnknownScale,
|
||||
currentScaleValue: null,
|
||||
initialBookmark: document.location.hash.substring(1),
|
||||
pinState: false,
|
||||
|
||||
setScale: function pdfViewSetScale(val, resetAutoSettings) {
|
||||
if (val == this.currentScale)
|
||||
|
@ -573,23 +572,7 @@ var PDFView = {
|
|||
},
|
||||
|
||||
pinSidebar: function pdfViewPinSidebar() {
|
||||
var sidebar = document.getElementById('sidebar');
|
||||
var pinIcon = document.getElementById('pinIcon');
|
||||
|
||||
var oldClass = 'released';
|
||||
var newClass = 'pinned';
|
||||
|
||||
if (this.pinState) {
|
||||
oldClass = 'pinned';
|
||||
newClass = 'released';
|
||||
}
|
||||
|
||||
sidebar.classList.remove(oldClass);
|
||||
pinIcon.classList.remove(oldClass);
|
||||
sidebar.classList.add(newClass);
|
||||
pinIcon.classList.add(newClass);
|
||||
|
||||
this.pinState = !this.pinState;
|
||||
document.getElementById('sidebar').classList.toggle('pinned');
|
||||
},
|
||||
|
||||
getVisiblePages: function pdfViewGetVisiblePages() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue