aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/functionality/view-khatian.ts
blob: 9f357629377e943c8a053758c24c3fdede22aa1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
declare function loadKhatian(): void;

document.addEventListener("DOMContentLoaded", () => {
	const proxiedPost = $.post;

	$.post = function() {
		if (arguments[0].startsWith("khDetailsAction_LandInfo.action")) {
			const callback = arguments[2];
			arguments[2] = (data: any) => {
				callback(data);
				const tableElement = document.querySelector("#khdetails > table > tbody > tr > td:nth-child(1) > div:nth-child(5) > table > tbody") as HTMLElement | null;
				if (tableElement) {
					tableElement.style.height = "auto";
					tableElement.style.width = "100%";
				}
			}
		}

		return proxiedPost.apply(this, Array.from(arguments) as any);
	}
});