@@ -2217,7 +2217,17 @@ export async function loadHomePage() {
2217
2217
const response = await GetPrefs . json ( )
2218
2218
2219
2219
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
+ }
2221
2231
if ( labelArray . length !== 0 ) {
2222
2232
const labelArray = response . payload . filter ( ( item : any ) => item . name === 'notices.filters' ) . map ( ( item : any ) => item . value ) [ 0 ] . split ( ' ' )
2223
2233
const xhr2 = new XMLHttpRequest ( )
@@ -2237,17 +2247,7 @@ export async function loadHomePage() {
2237
2247
const dateControl = document . querySelector ( 'input[type="date"]' ) as HTMLInputElement ;
2238
2248
xhr2 . send ( JSON . stringify ( { date : dateControl . value } ) ) ;
2239
2249
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
+
2251
2251
2252
2252
dateControl . addEventListener ( 'input' , onInputChange ) ;
2253
2253
}
0 commit comments