From 4a165eb403e59f5e219d5a8398d20ed5a9d23b5a Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Thu, 15 Jul 2021 20:20:43 -0600 Subject: [PATCH] Disable draw and zoom buttons when no document open --- src/index.html | 20 ++++++++++---------- src/js/pdf.js | 5 ++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/index.html b/src/index.html index 2af53fb..faf9f33 100644 --- a/src/index.html +++ b/src/index.html @@ -191,20 +191,20 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
Fit Height
-
Fit Width
-
Zoom Out
-
Zoom In
+
Fit Height
+
Fit Width
+
Zoom Out
+
Zoom In
-
Stamp/Seal
-
Sign (Client)
-
Sign (Notary)
-
Add Text
-
Add Certificate
-
Append Blank Page
+
Stamp/Seal
+
Sign (Client)
+
Sign (Notary)
+
Add Text
+
Add Certificate
+
Append Blank Page
Cancel
diff --git a/src/js/pdf.js b/src/js/pdf.js index 186cb32..4fa4e74 100644 --- a/src/js/pdf.js +++ b/src/js/pdf.js @@ -36,7 +36,8 @@ function addPDF() { }); renderAllPages(pdfDoc); - pdfZoom("fitwidth"); + pdfZoom("fitheight"); + $(".enable-when-doc-open").removeClass("disabled"); // Initial/first page rendering //renderPage(pageNum); }); @@ -51,6 +52,7 @@ function closePDF(showuserconfirm) { pageNumber = 0; pdfDoc = null; $("#page-canvas-container .page-canvas").remove(); + $(".enable-when-doc-open").addClass("disabled"); } function analyzeSignedPDF() { @@ -106,6 +108,7 @@ function analyzeSignedPDF() { }; fileReader.readAsArrayBuffer(html5file); } + $(".enable-when-doc-open").removeClass("disabled"); }; if (typeof nw != 'undefined') {