1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 12:30:56 +01:00
phorge-phorge/webroot/rsrc/js/application/calendar/behavior-recurring-edit.js
lkassianik 95551a1a5a DRAFT, recurring events need optional end dates
Summary: Ref T8357, DRAFT, recurring events need optional end dates

Test Plan: Edit recurring event, set end date, save, recurring ghosts should not generate after end date

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8357

Differential Revision: https://secure.phabricator.com/D13088
2015-06-01 18:56:11 -07:00

21 lines
538 B
JavaScript

/**
* @provides javelin-behavior-recurring-edit
*/
JX.behavior('recurring-edit', function(config) {
var checkbox = JX.$(config.isRecurring);
JX.DOM.listen(checkbox, 'change', null, function() {
var frequency = JX.$(config.frequency);
var end_date = JX.$(config.recurrenceEndDate);
frequency.disabled = checkbox.checked ? false : true;
end_date.disabled = checkbox.checked ? false : true;
if (end_date.disabled) {
JX.DOM.alterClass(end_date, 'datepicker-disabled', !checkbox.checked);
}
});
});