[Pkg-javascript-commits] [pdf.js] 179/246: Disable the "Go to First/Last Page" buttons when the first/last page is currently active
David Prévot
taffit at moszumanska.debian.org
Sun Sep 7 15:36:38 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit ca1dbda3483d32396c86417c62f129c4c87553db
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Tue Aug 12 12:34:27 2014 +0200
Disable the "Go to First/Last Page" buttons when the first/last page is currently active
Since the "Previous/Next Page" buttons are disabled when the first/last page is active, I think that for the sake of consistency the "Go to First/Last Page" should behave the same way.
---
web/viewer.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/web/viewer.js b/web/viewer.js
index 86f17b5..49d7968 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -2211,8 +2211,13 @@ window.addEventListener('pagechange', function pagechange(evt) {
}
}
}
+ var numPages = PDFView.pages.length;
+
document.getElementById('previous').disabled = (page <= 1);
- document.getElementById('next').disabled = (page >= PDFView.pages.length);
+ document.getElementById('next').disabled = (page >= numPages);
+
+ document.getElementById('firstPage').disabled = (page <= 1);
+ document.getElementById('lastPage').disabled = (page >= numPages);
}, true);
function handleMouseWheel(evt) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list