-
Notifications
You must be signed in to change notification settings - Fork 13
/
events.js
49 lines (40 loc) · 1.33 KB
/
events.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
jQuery(function() {
$('#send-emails-modal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
var header = button.data('title');
var list = button.data('list');
var modal = $(this);
modal.find('.modal-title').text(header);
modal.find('#send-emails-mailto').attr('href', 'mailto:' + list);
modal.find('#send-emails-list').val(list);
});
});
function addCustomApplicationField() {
$(CUSTOM_APPLICATION_FIELD_TEMPLATE)
.insertBefore('#add-custom-application-fields');
}
function removeCustomApplicationField(button) {
$(button).parents('.input-group').remove();
}
function addEventDatePicker() {
var picker = $('#event-add-date-picker');
$(EVENT_DATE_PICKER_TEMPLATE)
.insertBefore(picker);
enableDatepickers();
}
function removeEventDatePicker(button) {
$(button).parent('div').remove();
}
function flipAllCheckboxes(rootCheckbox) {
if (rootCheckbox.checked) {
jQuery(':checkbox.'.concat(rootCheckbox.className)).each(function() {
this.checked = true;
});
} else {
jQuery(':checkbox.'.concat(rootCheckbox.className)).each(function() {
this.checked = false;
});
}
}