- function hide_comment_form() {\r
- if (interval != null) {\r
- window.clearInterval(interval);\r
- interval = null;\r
+ if (length < min_length) {\r
+ $chars_left_message.hide();\r
+ $chars_togo_message.show();\r
+ $chars_counter.html(min_length - length);\r
+ } else {\r
+ length = $textarea.val().length;\r
+ $chars_togo_message.hide();\r
+ $chars_left_message.show();\r
+ $chars_counter.html(max_length - length);\r
+ }\r
+\r
+ if (length > max_length || length < min_length) {\r
+ $button.attr("disabled","disabled");\r
+ } else {\r
+ $button.removeAttr("disabled");\r
+ }\r
+\r
+ var current_height = textarea.style.height;\r
+ if (hcheck)\r
+ textarea.style.height = "0px";\r
+\r
+ var h = Math.max(80, textarea.scrollHeight);\r
+ textarea.style.height = current_height;\r
+ $textarea.animate({height: h + 'px'}, 50);\r
+\r
+ current_length = length;\r