Spaces:
Sleeping
Sleeping
Update templates/gui.html
Browse files- templates/gui.html +3 -2
templates/gui.html
CHANGED
|
@@ -10,11 +10,12 @@
|
|
| 10 |
<script>
|
| 11 |
function openPdf() {
|
| 12 |
// Ensure Flask passes a default value of 1 if page is not specified
|
|
|
|
| 13 |
const page = {{ page if page else 1 }}; // Pass `1` as a fallback value
|
| 14 |
-
|
| 15 |
if (page && parseInt(page) > 0) {
|
| 16 |
// Open PDF on a new tab with Flask URL and the specified page number
|
| 17 |
-
window.location.href = `/view-pdf
|
| 18 |
} else {
|
| 19 |
alert('Please enter a valid page number');
|
| 20 |
}
|
|
|
|
| 10 |
<script>
|
| 11 |
function openPdf() {
|
| 12 |
// Ensure Flask passes a default value of 1 if page is not specified
|
| 13 |
+
|
| 14 |
const page = {{ page if page else 1 }}; // Pass `1` as a fallback value
|
| 15 |
+
console.log(page)
|
| 16 |
if (page && parseInt(page) > 0) {
|
| 17 |
// Open PDF on a new tab with Flask URL and the specified page number
|
| 18 |
+
window.location.href = `/view-pdf#page=${page}`;
|
| 19 |
} else {
|
| 20 |
alert('Please enter a valid page number');
|
| 21 |
}
|