##// END OF EJS Templates
Setting focus to text area after reply.
Pavel Ryapolov -
r107:6af33f1b default
parent child Browse files
Show More
@@ -81,12 +81,14 b' function moveCaretToEnd(el) {'
81
81
82 function addQuickReply(postId) {
82 function addQuickReply(postId) {
83 var textToAdd = '>>' + postId + '\n\n';
83 var textToAdd = '>>' + postId + '\n\n';
84 $('#id_text').val($('#id_text').val()+ textToAdd);
84 var textAreaId = '#id_text';
85 $(textAreaId).val($(textAreaId).val()+ textToAdd);
85
86
86 var textarea = document.getElementById('id_text');
87 var textarea = document.getElementById('id_text');
88 $(textAreaId).focus();
87 moveCaretToEnd(textarea);
89 moveCaretToEnd(textarea);
88
90
89 $("html, body").animate({ scrollTop: $('#id_text').offset().top }, "slow");
91 $("html, body").animate({ scrollTop: $(textAreaId).offset().top }, "slow");
90 }
92 }
91
93
92 $(document).ready(function(){
94 $(document).ready(function(){
General Comments 0
You need to be logged in to leave comments. Login now