diff --git a/boards/static/js/form.js b/boards/static/js/form.js --- a/boards/static/js/form.js +++ b/boards/static/js/form.js @@ -19,23 +19,4 @@ var isCompact = false; fileReader.readAsDataURL(file); } -}); - -var fullForm = $('.swappable-form-full'); - -function swapForm() { - if (isCompact) { - // TODO Use IDs (change the django form code) instead of absolute numbers - fullForm.find('textarea').appendTo(fullForm.find('.form-row')[4].children[0]); - fullForm.find('.file_wrap').appendTo(fullForm.find('.form-row')[7].children[0]); - fullForm.find('.form-row').show(); - - scrollToBottom(); - } else { - fullForm.find('textarea').appendTo($('.compact-form-text')); - fullForm.find('.file_wrap').insertBefore($('.compact-form-text')); - fullForm.find('.form-row').hide(); - fullForm.find('input[type=text]').val(''); - } - isCompact = !isCompact; -} +}); \ No newline at end of file diff --git a/boards/static/js/thread.js b/boards/static/js/thread.js --- a/boards/static/js/thread.js +++ b/boards/static/js/thread.js @@ -23,6 +23,8 @@ for the JavaScript code in this page. */ +var $html = $("html, body"); + function moveCaretToEnd(el) { if (typeof el.selectionStart == "number") { el.selectionStart = el.selectionEnd = el.value.length; @@ -48,14 +50,9 @@ function addQuickReply(postId) { $(textAreaId).focus(); moveCaretToEnd(textarea); - $("html, body").animate({ scrollTop: $(textAreaId).offset().top }, "slow"); + $html.animate({ scrollTop: $(textAreaId).offset().top }, "slow"); } function scrollToBottom() { - var $target = $('html,body'); - $target.animate({scrollTop: $target.height()}, "fast"); -} - -$(document).ready(function() { - swapForm(); -}) + $html.animate({scrollTop: $html.height()}, "fast"); +} \ No newline at end of file