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:
Chris Hill-Scott
2016-02-22 12:16:19 +00:00
parent bf3f6d7d3e
commit 97a3bf9225
14 changed files with 37 additions and 76 deletions

View File

@@ -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);
};