Show loading placeholder

Form loads after ajax call, so it can take some time on big responses and slow connection
This commit is contained in:
Łukasz Mierzwa
2017-04-22 14:37:36 -07:00
parent 575dc245b1
commit 020b1a2728
4 changed files with 13 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ var Templates = (function(params) {
silenceFormSuccess: '#silence-form-success',
silenceFormError: '#silence-form-error',
silenceFormFatal: '#silence-form-fatal',
silenceFormLoading: '#silence-form-loading',
// label button
buttonLabel: '#label-button-filter',

View File

@@ -135,6 +135,9 @@ var UI = (function(params) {
var modal = $("#silenceModal");
modal.on("show.bs.modal", function(event) {
Unsee.Pause();
modal.find(".modal-body").html(
Templates.Render("silenceFormLoading", {})
);
var elem = $(event.relatedTarget);
var elemLabels = {};
$.each(elem.data("labels").split(","), function(i, l) {

View File

@@ -128,3 +128,9 @@
<i class="fa fa-exclamation-circle"></i>
<%- error %>
</script>
<script type="application/json" id="silence-form-loading">
<div class="silence-result-icon text-center text-muted">
<i class="fa fa-refresh fa-spin"></i>
</div>
</script>

File diff suppressed because one or more lines are too long