diff --git a/boards/static/css/base.css b/boards/static/css/base.css --- a/boards/static/css/base.css +++ b/boards/static/css/base.css @@ -73,4 +73,9 @@ textarea, input { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -} \ No newline at end of file +} + +.compact-form-text > textarea { + height: 100px; + width: 100%; +} 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 @@ -1,4 +1,4 @@ -var isCompact = true; +var isCompact = false; $('input[name=image]').wrap($('
')); @@ -21,25 +21,25 @@ var isCompact = true; } }); -var compactForm = $('.swappable-form-compact'); var fullForm = $('.swappable-form-full'); function swapForm() { - compactForm.toggle(); - fullForm.toggle(); - if (isCompact) { - var oldText = compactForm.find('textarea')[0].value; - fullForm.find('textarea')[0].value = oldText; + // TODO Use IDs (change the django form code) instead of absolute numbers + fullForm.find('textarea').appendTo(fullForm.find('.form-row')[4]); + fullForm.find('.file_wrap').appendTo(fullForm.find('.form-row')[7]); + fullForm.find('.form-row').show(); } else { - var oldText = fullForm.find('textarea')[0].value; - compactForm.find('textarea')[0].value = oldText; + 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; - + scrollToBottom(); } -if (compactForm.length > 0) { - fullForm.toggle(); -} +$(document).ready(function() { + swapForm(); +}) diff --git a/boards/templates/boards/thread.html b/boards/templates/boards/thread.html --- a/boards/templates/boards/thread.html +++ b/boards/templates/boards/thread.html @@ -49,23 +49,10 @@
{% trans "Reply to thread" %} #{{ opening_post.id }}
-
-
{% csrf_token %} - -
- -
-
- -
-
-
{% csrf_token %} +
{{ form.as_div }}