From cb0f3cd0747c66a2c0739b7a6381d8104d85f942 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sat, 29 Dec 2018 11:16:36 +0100 Subject: [PATCH] Fix #696 --- cps/static/js/main.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 2b08fdf4..3a867418 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -104,7 +104,10 @@ $(function() { var $this = $(this); var buttonText = $this.html(); $this.html("..."); - $("#update_error").addClass("hidden") + $("#update_error").addClass("hidden"); + if($("#message").length){ + $("#message").alert("close"); + } $.ajax({ dataType: "json", url: window.location.pathname + "/../../get_update_status", @@ -125,15 +128,15 @@ $(function() { data.history.reverse().forEach(function(entry, index) { $("" + entry[0] + "" + entry[1] + "").appendTo($("#update_table")); }); - cssClass = 'alert-warning' + cssClass = 'alert-warning'; } else { - cssClass = 'alert-success' + cssClass = 'alert-success'; } } else { - cssClass = 'alert-danger' + cssClass = 'alert-danger'; } - message = '
×' + data.message + '
'; $(message).insertAfter($("#update_table"));