Summary:
This feels a little cleaner:
- Clean up transaction log a bit.
- Use a checkbox instead of a two-option dropdown.
This is a little messy because the browser doesn't send anything if the user submits a form with an un-clicked checkbox.
We now send a dummy value ("Hey, there's definitely a checkbox in this form!") so the server can figure out what to do.
Test Plan:
- Edited all-dayness of an event.
- Viewed transaction log.
Reviewers: chad
Reviewed By: chad
Differential Revision: https://secure.phabricator.com/D16776
18 lines
419 B
JavaScript
18 lines
419 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 = !!all_day.checked;
|
|
|
|
for (var ii = 0; ii < config.controlIDs.length; ii++) {
|
|
var control = JX.$(config.controlIDs[ii]);
|
|
JX.DOM.alterClass(control, 'no-time', is_all_day);
|
|
}
|
|
});
|
|
|
|
});
|