From 0f8593da3e75b8d44399c5f04edf000555b7406a Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Thu, 6 Apr 2023 22:17:13 +0530 Subject: Now downloading plot information pdf as well. --- src/scripts/functionality/view-khatian/index.ts | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/scripts/functionality/view-khatian/index.ts') diff --git a/src/scripts/functionality/view-khatian/index.ts b/src/scripts/functionality/view-khatian/index.ts index baf6d8e..0cb3947 100644 --- a/src/scripts/functionality/view-khatian/index.ts +++ b/src/scripts/functionality/view-khatian/index.ts @@ -1,7 +1,7 @@ import { downloadPDF } from "@/shared/download-pdf"; -import getKhatinDetailsPDFPageData from "@/scripts/functionality/view-khatian/khatian-download-document"; +import getDetailsPDFContent from "@/scripts/functionality/view-khatian/download-document-content"; -declare function loadKhatian(): void; +declare function load(): void; document.addEventListener("DOMContentLoaded", () => { const proxiedPost = $.post; @@ -23,21 +23,33 @@ document.addEventListener("DOMContentLoaded", () => { return element.options[element.selectedIndex].text; }; - const downloadKhatianInformationPDF = () => { - const documentStringContent = getKhatinDetailsPDFPageData(document.querySelector("#khdetails")!.innerHTML, { + let isPlotInformation: boolean | null = null; + + const downloadInformationPDF = () => { + let contentElement = document.getElementById(isPlotInformation ? "plotdetails" : "khdetails"); + const documentStringContent = getDetailsPDFContent(!!isPlotInformation, contentElement!.innerHTML, { district: getValueOfSelectElement("#lstDistrictCode1"), block: getValueOfSelectElement("#lstBlockCode1"), mouza: getValueOfSelectElement("#lstMouzaList") }); - downloadPDF(`