Create JS hook for template reset

This commit is contained in:
CactusPuppy 2021-03-05 12:39:50 -08:00
parent 1f9da86e39
commit 71ce82c968
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82

View file

@ -189,6 +189,18 @@ $( document ).ready(function() {
var max = $selected.data("max-words");
word_count(this, 'submission-count', max);
});
/* Listen for reset template button, wait for confirm, and reset. */
$('#sub_text_reset').click((e) => {
let $selected = $("#event_event_type_id option:selected");
let $this = $(e.target);
let affirm = confirm($this.data('confirm'));
if (affirm) {
let sub_text = $('#event_submission_text');
sub_text.val($selected.data('help'));
sub_text.trigger('change');
}
});
});
/* Commodity function for modal windows */