##// END OF EJS Templates
Removed compact form
neko259 -
r970:579d6b3a default
parent child Browse files
Show More
@@ -19,23 +19,4 b' var isCompact = false;'
19
19
20 fileReader.readAsDataURL(file);
20 fileReader.readAsDataURL(file);
21 }
21 }
22 });
22 }); No newline at end of file
23
24 var fullForm = $('.swappable-form-full');
25
26 function swapForm() {
27 if (isCompact) {
28 // TODO Use IDs (change the django form code) instead of absolute numbers
29 fullForm.find('textarea').appendTo(fullForm.find('.form-row')[4].children[0]);
30 fullForm.find('.file_wrap').appendTo(fullForm.find('.form-row')[7].children[0]);
31 fullForm.find('.form-row').show();
32
33 scrollToBottom();
34 } else {
35 fullForm.find('textarea').appendTo($('.compact-form-text'));
36 fullForm.find('.file_wrap').insertBefore($('.compact-form-text'));
37 fullForm.find('.form-row').hide();
38 fullForm.find('input[type=text]').val('');
39 }
40 isCompact = !isCompact;
41 }
@@ -23,6 +23,8 b''
23 for the JavaScript code in this page.
23 for the JavaScript code in this page.
24 */
24 */
25
25
26 var $html = $("html, body");
27
26 function moveCaretToEnd(el) {
28 function moveCaretToEnd(el) {
27 if (typeof el.selectionStart == "number") {
29 if (typeof el.selectionStart == "number") {
28 el.selectionStart = el.selectionEnd = el.value.length;
30 el.selectionStart = el.selectionEnd = el.value.length;
@@ -48,14 +50,9 b' function addQuickReply(postId) {'
48 $(textAreaId).focus();
50 $(textAreaId).focus();
49 moveCaretToEnd(textarea);
51 moveCaretToEnd(textarea);
50
52
51 $("html, body").animate({ scrollTop: $(textAreaId).offset().top }, "slow");
53 $html.animate({ scrollTop: $(textAreaId).offset().top }, "slow");
52 }
54 }
53
55
54 function scrollToBottom() {
56 function scrollToBottom() {
55 var $target = $('html,body');
57 $html.animate({scrollTop: $html.height()}, "fast");
56 $target.animate({scrollTop: $target.height()}, "fast");
58 } No newline at end of file
57 }
58
59 $(document).ready(function() {
60 swapForm();
61 })
General Comments 0
You need to be logged in to leave comments. Login now