diff --git a/js/privatebin.js b/js/privatebin.js index c7528822..d8aa56e0 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -871,12 +871,12 @@ $(function() { '
' + '' + '' + - '
' + - '
' + - '
' + '
' ); reply.find('button').click({parentid: commentid}, $.proxy(this.sendComment, this)); source.after(reply); + this.replyStatus = $('#replystatus'); $('#replymessage').focus(); }, @@ -1409,7 +1409,18 @@ $(function() { this.errorMessage.removeClass('hidden'); helper.setMessage(this.errorMessage, message); } - this.replyStatus.addClass('errorMessage').text(message); + if (typeof this.replyStatus !== 'undefined') { + this.replyStatus.addClass('errorMessage'); + this.replyStatus.addClass(this.errorMessage.attr('class')); + if (this.status.length) + { + this.replyStatus.html(this.status.html()); + } + else + { + this.replyStatus.html(this.errorMessage.html()); + } + } }, /** @@ -1421,7 +1432,9 @@ $(function() { */ showStatus: function(message, spin) { - this.replyStatus.removeClass('errorMessage').text(message); + if (typeof this.replyStatus !== 'undefined') { + this.replyStatus.removeClass('errorMessage').text(message); + } if (!message) { this.status.html(' '); @@ -1437,7 +1450,9 @@ $(function() { { var img = ''; this.status.prepend(img); - this.replyStatus.prepend(img); + if (typeof this.replyStatus !== 'undefined') { + this.replyStatus.prepend(img); + } } }, @@ -1506,7 +1521,6 @@ $(function() { this.preview = $('#preview'); this.rawTextButton = $('#rawtextbutton'); this.remainingTime = $('#remainingtime'); - this.replyStatus = $('#replystatus'); this.sendButton = $('#sendbutton'); this.status = $('#status'); this.bindEvents();