Show More
@@ -73,4 +73,9 b' textarea, input {' | |||
|
73 | 73 | -moz-box-sizing: border-box; |
|
74 | 74 | -webkit-box-sizing: border-box; |
|
75 | 75 | box-sizing: border-box; |
|
76 | } No newline at end of file | |
|
76 | } | |
|
77 | ||
|
78 | .compact-form-text > textarea { | |
|
79 | height: 100px; | |
|
80 | width: 100%; | |
|
81 | } |
@@ -1,4 +1,4 b'' | |||
|
1 |
var isCompact = |
|
|
1 | var isCompact = false; | |
|
2 | 2 | |
|
3 | 3 | $('input[name=image]').wrap($('<div class="file_wrap"></div>')); |
|
4 | 4 | |
@@ -21,25 +21,25 b' var isCompact = true;' | |||
|
21 | 21 | } |
|
22 | 22 | }); |
|
23 | 23 | |
|
24 | var compactForm = $('.swappable-form-compact'); | |
|
25 | 24 | var fullForm = $('.swappable-form-full'); |
|
26 | 25 | |
|
27 | 26 | function swapForm() { |
|
28 | compactForm.toggle(); | |
|
29 | fullForm.toggle(); | |
|
30 | ||
|
31 | 27 | if (isCompact) { |
|
32 | var oldText = compactForm.find('textarea')[0].value; | |
|
33 |
fullForm.find('textarea')[ |
|
|
28 | // TODO Use IDs (change the django form code) instead of absolute numbers | |
|
29 | fullForm.find('textarea').appendTo(fullForm.find('.form-row')[4]); | |
|
30 | fullForm.find('.file_wrap').appendTo(fullForm.find('.form-row')[7]); | |
|
31 | fullForm.find('.form-row').show(); | |
|
34 | 32 | } else { |
|
35 | var oldText = fullForm.find('textarea')[0].value; | |
|
36 | compactForm.find('textarea')[0].value = oldText; | |
|
33 | fullForm.find('textarea').appendTo($('.compact-form-text')); | |
|
34 | fullForm.find('.file_wrap').insertBefore($('.compact-form-text')); | |
|
35 | fullForm.find('.form-row').hide(); | |
|
36 | fullForm.find('input[type=text]').val(''); | |
|
37 | 37 | } |
|
38 | 38 | isCompact = !isCompact; |
|
39 | 39 | |
|
40 | 40 | scrollToBottom(); |
|
41 | 41 | } |
|
42 | 42 | |
|
43 | if (compactForm.length > 0) { | |
|
44 | fullForm.toggle(); | |
|
45 | } | |
|
43 | $(document).ready(function() { | |
|
44 | swapForm(); | |
|
45 | }) |
@@ -49,23 +49,10 b'' | |||
|
49 | 49 | <script src="{% static 'js/panel.js' %}"></script> |
|
50 | 50 | <div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}</div> |
|
51 | 51 | <div class="post-form" id="compact-form"> |
|
52 | <div class="swappable-form-compact"> | |
|
53 | <form enctype="multipart/form-data" method="post" | |
|
54 | >{% csrf_token %} | |
|
55 | <input type="file" name="image" accept="image/*"/> | |
|
56 | <div class="compact-form-text"> | |
|
57 | <textarea name="text" style="height: 100px; | |
|
58 | width: 100%; | |
|
59 | "></textarea> | |
|
60 | </div> | |
|
61 | <div class="form-submit"> | |
|
62 | <input type="submit" value="{% trans "Post" %}"/> | |
|
63 | </div> | |
|
64 | </form> | |
|
65 | </div> | |
|
66 | 52 | <div class="swappable-form-full"> |
|
67 | 53 | <form enctype="multipart/form-data" method="post" |
|
68 | 54 | >{% csrf_token %} |
|
55 | <div class="compact-form-text"></div> | |
|
69 | 56 | {{ form.as_div }} |
|
70 | 57 | <div class="form-submit"> |
|
71 | 58 | <input type="submit" value="{% trans "Post" %}"/> |
General Comments 0
You need to be logged in to leave comments.
Login now