2015-05-29 02:27:25 +02:00
|
|
|
/**
|
|
|
|
* @provides javelin-behavior-recurring-edit
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
JX.behavior('recurring-edit', function(config) {
|
|
|
|
var checkbox = JX.$(config.isRecurring);
|
2015-06-02 03:56:11 +02:00
|
|
|
|
2015-05-29 02:27:25 +02:00
|
|
|
JX.DOM.listen(checkbox, 'change', null, function() {
|
|
|
|
var frequency = JX.$(config.frequency);
|
2015-06-02 03:56:11 +02:00
|
|
|
var end_date = JX.$(config.recurrenceEndDate);
|
2015-05-29 02:27:25 +02:00
|
|
|
|
|
|
|
frequency.disabled = checkbox.checked ? false : true;
|
2015-06-02 03:56:11 +02:00
|
|
|
end_date.disabled = checkbox.checked ? false : true;
|
|
|
|
|
|
|
|
if (end_date.disabled) {
|
|
|
|
JX.DOM.alterClass(end_date, 'datepicker-disabled', !checkbox.checked);
|
|
|
|
}
|
2015-05-29 02:27:25 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|