Use toastr notifications instead of statusBarSet()

This commit is contained in:
2017-10-02 19:31:52 +02:00
parent 9870979c54
commit d3cd6a884e
6 changed files with 29 additions and 34 deletions

View File

@@ -155,7 +155,7 @@ script(type="text/javascript").
var $file = $('.form-group.file #file');
if ($file.val() == '') {
$file.addClass('error');
statusBarSet('error', 'No File Selected', 'pi-warning', 5000);
toastr.error('No file selected');
return jQuery.Deferred().reject("nofile");
}
@@ -173,10 +173,9 @@ script(type="text/javascript").
.fail(function(data){
/* Something went wrong, print it */
if (data.status == 422) {
statusBarSet('error', 'The submitted data could not be validated.', 'pi-warning', 8000);
toastr.error('The submitted data could not be validated');
} else {
statusBarSet('error', "Error! We've been notified and are working on it - "
+ data.status + ' ' + data.statusText, 'pi-warning', 8000);
toastr.error(data.status + ' ' + data.statusText, 'Error saving');
}
$("li.button-save").addClass('field-error');
@@ -196,7 +195,7 @@ script(type="text/javascript").
{% if is_embedded_edit %}
/* Load content*/
$('#project_context').html(dataHtml);
statusBarSet('success', 'Saved Successfully', 'pi-check');
toastr.success('Saved!');
/* Style button */
$("li.button-save").removeClass('saving field-error');