From 9687144c9226cd9ad53c963c7cb8acc34041adad Mon Sep 17 00:00:00 2001 From: Hexalyse Date: Sat, 5 Sep 2015 14:38:53 +0200 Subject: [PATCH] Error messages are now replaced and not appended Error messages are now replaced and not appended in the #errormessage div, without removing the glyphicon (which a .text() would have done). This way, we don't have HTML code in the JS (which would be ugly). But it's still not a really elegant solution. --- js/zerobin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/zerobin.js b/js/zerobin.js index fe8576bf..7258cde4 100644 --- a/js/zerobin.js +++ b/js/zerobin.js @@ -535,7 +535,9 @@ function showError(message) { if ($('#status').length) { $('#status').addClass('errorMessage').text(message); } else { - $('#errormessage').removeClass('hidden').append(message); + $('#errormessage').removeClass('hidden'); + var content = $('#errormessage').contents(); + content[content.length - 1].nodeValue = message; } $('#replystatus').addClass('errorMessage').text(message); }