Merge pull request #1057 from edx/usman/lms-1114-pdf-arrows
Disables the previous/next arrows on pdf books on the first/last pages
This commit is contained in:
12
common/static/js/pdfviewer.js
Normal file → Executable file
12
common/static/js/pdfviewer.js
Normal file → Executable file
@@ -200,6 +200,18 @@ PDFJS.disableWorker = true;
|
||||
document.getElementById('numPages').textContent = 'of ' + pdfDocument.numPages;
|
||||
$("#pageNumber").max = pdfDocument.numPages;
|
||||
$("#pageNumber").val(pageNum);
|
||||
|
||||
// Enable/disable the previous/next buttons
|
||||
if (pageNum <= 1) {
|
||||
$("#previous").addClass("is-disabled");
|
||||
} else {
|
||||
$("#previous").removeClass("is-disabled");
|
||||
}
|
||||
if (pageNum >= pdfDocument.numPages) {
|
||||
$("#next").addClass("is-disabled");
|
||||
} else {
|
||||
$("#next").removeClass("is-disabled");
|
||||
}
|
||||
}
|
||||
|
||||
// Go to previous page
|
||||
|
||||
7
lms/static/sass/course/_textbook.scss
Normal file → Executable file
7
lms/static/sass/course/_textbook.scss
Normal file → Executable file
@@ -163,10 +163,13 @@ div.book-wrapper {
|
||||
|
||||
&:hover {
|
||||
opacity: 1.0;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
|
||||
&.is-disabled {
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.last {
|
||||
left: 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user