summaryrefslogtreecommitdiff
path: root/js/quick-reply.js
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-09-18 21:37:31 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-09-18 21:37:31 +1000
commit8a5d6b1d3f2d9ce8177c240f78b9b1801bc7306c (patch)
treee9721bbfbf6061933fbd6dd56cf560c8313815f3 /js/quick-reply.js
parent06f8c03e180c35f1f2b1411526ce534bd74bb57c (diff)
I messed up that merge.
Diffstat (limited to 'js/quick-reply.js')
-rw-r--r--js/quick-reply.js36
1 files changed, 2 insertions, 34 deletions
diff --git a/js/quick-reply.js b/js/quick-reply.js
index e02332ba..91c35222 100644
--- a/js/quick-reply.js
+++ b/js/quick-reply.js
@@ -299,6 +299,8 @@
if (typeof $postForm.draggable != 'undefined') {
if (localStorage.quickReplyPosition) {
var offset = JSON.parse(localStorage.quickReplyPosition);
+ if (offset.top < 0)
+ offset.top = 0;
if (offset.right > $(window).width() - $postForm.width())
offset.right = $(window).width() - $postForm.width();
if (offset.top > $(window).height() - $postForm.height())
@@ -321,40 +323,6 @@
}
});
$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() {