From 87926ce157126f01e9f800c8a1f171e0ff44f2ca Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 15 Aug 2016 15:38:21 +0200 Subject: [PATCH] reactivated second error message for comments between textarea and button, fixes #62 --- js/privatebin.js | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index c752882..d8aa56e 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();