mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
Remove the ‘manage templates’ page
The ‘manage templates’ page was almost identical to the ‘send text messages’ page. This commit consolidates them into one and makes them all hang together. Part of this means tweaks to the javascript so that files upload as soon as you’ve chosen them.
This commit is contained in:
@@ -3,22 +3,20 @@
|
||||
|
||||
Modules.FileUpload = function() {
|
||||
|
||||
let $field, $button, $filename;
|
||||
let $field;
|
||||
|
||||
this.update = function() {
|
||||
this.submit = function() {
|
||||
|
||||
$filename.text($field.val().split('\\').pop());
|
||||
$field.parents('form').trigger('submit');
|
||||
|
||||
};
|
||||
|
||||
this.start = function(component) {
|
||||
|
||||
$field = $('.file-upload-field', component);
|
||||
$button = $('.file-upload-button', component);
|
||||
$filename = $('.file-upload-filename', component);
|
||||
|
||||
// Need to put the event on the container, not the input for it to work properly
|
||||
$(component).on('change', '.file-upload-field', this.update);
|
||||
$(component).on('change', '.file-upload-field', this.submit);
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user