Fixed the create new alert template / edit template bug

This commit is contained in:
laf
2016-06-13 19:44:14 +00:00
parent 779c4dee71
commit ed0479a2f3

View File

@@ -102,9 +102,10 @@ $('#alert-template').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget); var button = $(event.relatedTarget);
var template_id = button.data('template_id'); var template_id = button.data('template_id');
var action = button.data('template_action'); var action = button.data('template_action');
$('#template').val(); $('#template').val('');
$('#line').val(''); $('#line').val('');
$('#value').val(''); $('#value').val('');
$('#name').val('');
if(action == 'edit') { if(action == 'edit') {
$('#template_id').val(template_id); $('#template_id').val(template_id);
$.ajax({ $.ajax({
@@ -121,6 +122,9 @@ $('#alert-template').on('show.bs.modal', function (event) {
}); });
} }
}); });
$('#alert-template').on('hide.bs.modal', function(event) {
$('#template_id').val('');
});
$('#create-template').click('', function(e) { $('#create-template').click('', function(e) {
e.preventDefault(); e.preventDefault();