1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-21 01:38:48 +02:00
phorge-phorge/webroot/rsrc/js/application/calendar/behavior-event-all-day.js
epriestley e5256bd815 Hide time controls when editing all-day Calendar events
Summary:
Ref T11326. When an event is all-day, hide the time controls for the start/end dates. These aren't used and aren't helpful/useful.

This got a little more complicated than it used to be because EditEngine forms may have only some of these controls present.

Test Plan: Edited an all-day event; edited a normal event; swapped an event between normal and all-day.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11326

Differential Revision: https://secure.phabricator.com/D16327
2016-07-27 05:01:19 -07:00

17 lines
431 B
JavaScript

/**
* @provides javelin-behavior-event-all-day
*/
JX.behavior('event-all-day', function(config) {
var all_day = JX.$(config.allDayID);
JX.DOM.listen(all_day, 'change', null, function() {
var is_all_day = !!parseInt(all_day.value, 10);
for (var ii = 0; ii < config.controlIDs.length; ii++) {
var control = JX.$(config.controlIDs[ii]);
JX.DOM.alterClass(control, 'no-time', is_all_day);
}
});
});