diff options
| author | czaks <marcin@6irc.net> | 2013-09-17 18:15:59 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-18 21:34:37 +1000 |
| commit | 06f8c03e180c35f1f2b1411526ce534bd74bb57c (patch) | |
| tree | 9389386aca9cbf2e0e2f020e8d760478f01651c1 /js | |
| parent | 70e5d64c1bec487db027ba8a176b0bc5cfea2c82 (diff) | |
fix quickreply when recorded position is <0
Conflicts:
js/quick-reply.js
Diffstat (limited to 'js')
| -rw-r--r-- | js/quick-reply.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/quick-reply.js b/js/quick-reply.js index c1989824..e02332ba 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -321,6 +321,40 @@ } }); $postForm.find('th .handle').css('cursor', 'move'); + + // Synchronise body text with original post form + $origPostForm.find('textarea[name="body"]').bind('change input propertychange', function() { + $postForm.find('textarea[name="body"]').val($(this).val()); + }); + $postForm.find('textarea[name="body"]').bind('change input propertychange', function() { + $origPostForm.find('textarea[name="body"]').val($(this).val()); + }); + $postForm.find('textarea[name="body"]').focus(function() { + $origPostForm.find('textarea[name="body"]').removeAttr('id'); + $(this).attr('id', 'body'); + }); + $origPostForm.find('textarea[name="body"]').focus(function() { + $postForm.find('textarea[name="body"]').removeAttr('id'); + $(this).attr('id', 'body'); + }); + // Synchronise other inputs + $origPostForm.find('input[type="text"],select').bind('change input propertychange', function() { + $postForm.find('[name="' + $(this).attr('name') + '"]').val($(this).val()); + }); + $postForm.find('input[type="text"],select').bind('change input propertychange', function() { + $origPostForm.find('[name="' + $(this).attr('name') + '"]').val($(this).val()); + }); + + if (typeof $postForm.draggable != 'undefined') { + if (localStorage.quickReplyPosition) { + var offset = JSON.parse(localStorage.quickReplyPosition); + if (offset.top < 0) + offset.top = 10; + if (offset.right > $(window).width() - $postForm.width()) + offset.right = $(window).width() - $postForm.width(); + if (offset.top > $(window).height() - $postForm.height()) + offset.top = $(window).height() - $postForm.height(); + $postForm.css('right', offset.right).css('top', offset.top); } $postForm.find('th .close-btn').click(function() { |
