diff --git a/js/kronolith.js b/js/kronolith.js index 7863ef77..879a5c25 100644 --- a/js/kronolith.js +++ b/js/kronolith.js @@ -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);