Skip to content

Commit c032a2a

Browse files
authored
fix: Move function declaration to function body root.
1 parent 9f6d57c commit c032a2a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/SEQTA.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,17 @@ export async function loadHomePage() {
22172217
const response = await GetPrefs.json()
22182218

22192219
const labelArray = response.payload.filter((item: any) => item.name === 'notices.filters').map((item: any) => item.value)
2220-
2220+
function onInputChange(e: any) {
2221+
xhr2.open('POST', `${location.origin}/seqta/student/load/notices?`, true);
2222+
xhr2.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
2223+
xhr2.send(JSON.stringify({ date: e.target.value }));
2224+
2225+
xhr2.onreadystatechange = function () {
2226+
if (xhr2.readyState === 4) {
2227+
processNotices(xhr2.response, labelArray);
2228+
}
2229+
};
2230+
}
22212231
if (labelArray.length !== 0) {
22222232
const labelArray = response.payload.filter((item: any) => item.name === 'notices.filters').map((item: any) => item.value)[0].split(' ')
22232233
const xhr2 = new XMLHttpRequest()
@@ -2237,17 +2247,7 @@ export async function loadHomePage() {
22372247
const dateControl = document.querySelector('input[type="date"]') as HTMLInputElement;
22382248
xhr2.send(JSON.stringify({ date: dateControl.value }));
22392249

2240-
function onInputChange(e: any) {
2241-
xhr2.open('POST', `${location.origin}/seqta/student/load/notices?`, true);
2242-
xhr2.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
2243-
xhr2.send(JSON.stringify({ date: e.target.value }));
2244-
2245-
xhr2.onreadystatechange = function () {
2246-
if (xhr2.readyState === 4) {
2247-
processNotices(xhr2.response, labelArray);
2248-
}
2249-
};
2250-
}
2250+
22512251

22522252
dateControl.addEventListener('input', onInputChange);
22532253
}

0 commit comments

Comments
 (0)