-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.js
29 lines (25 loc) · 1.04 KB
/
jquery.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
jQuery stellt sicher, dass die function erst nach dem geladenen DOM ausgeführt wird.
*/
$(function () {
handleElementDisplaying(false);
htmlElements.JOB().on('change', handleSelectedJob);
htmlElements.CLASS().on('change', handleSelectedClass);
htmlElements.PREVIOUS().on('click', handlePreviousWeekButton);
htmlElements.NEXT().on('click', handleNextWeekButton);
htmlElements.CURRENT().on('click', handleCurrentWeekButton);
getBerufe().then((jobs) => {
const optionGroups = prepareOptionGroupsForBerufsgruppe(jobs);
$('select.berufsgruppe').append(optionGroups);
const options = prepareOptionsBerufe(jobs);
options.forEach((option) => {
const optionGroup = $(`optgroup[label = ${option.name[0]}]`);
optionGroup.append(option.tag);
});
const jobId = localStorage.getItem(storageKeys.JOB_ID);
if (jobId) {
$(`#berufsgruppenAuswahl >> option[value=${jobId}]`).prop('selected', true);
handleSelectedJob();
}
});
});