Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions js/kronolith.js
Original file line number Diff line number Diff line change
Expand Up @@ -3853,8 +3853,21 @@ KronolithCore = {
data.owner_input = null;
}
if (data.type == 'holiday') {
this.insertCalendarInList('holiday', data.driver, Kronolith.conf.calendars.holiday[data.driver]);
this.toggleCalendar('holiday', data.driver);

// getting the holidays that are listed but unselected
let check = this.getCalendarList(data.type);
let checklist = check.select('span.horde-resource-off').map(
item => item = item.textContent
);

// checking if the new calendar is in the unselected list
if (checklist.indexOf(data.driver) > -1){
this.toggleCalendar('holiday', data.driver);
}else{
this.insertCalendarInList('holiday', data.driver, Kronolith.conf.calendars.holiday[data.driver]);
this.toggleCalendar('holiday', data.driver);
}

form.down('.kronolithCalendarSave').enable();
this.closeRedBox();
this.go(this.lastLocation);
Expand Down