From adb6749310ff75f684f730c6e3144194046536a9 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 15 Feb 2013 23:58:56 +0100 Subject: Rearrange upload form This allows the textarea to be wider without vanishing behind the file upload form. Signed-off-by: Florian Pritz --- application/views/file/upload_form.php | 28 ++++++++++++++-------------- data/js/script.js | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php index f0c1ab933..c2ee18e2f 100644 --- a/application/views/file/upload_form.php +++ b/application/views/file/upload_form.php @@ -1,31 +1,31 @@
-
-
+

Text paste

- + -
+
+

File upload


-
-

Notice!

-

- Uploads/pastes are deleted after days - 0) { - echo "unless they are smaller than ".format_bytes($small_upload_size); - } ?>. Maximum upload size is . - You can upload a maximum of files at once. -

-
+
+
+

Notice!

+

+ Uploads/pastes are deleted after days + 0) { + echo "unless they are smaller than ".format_bytes($small_upload_size); + } ?>. Maximum upload size is . + You can upload a maximum of files at once. +

diff --git a/data/js/script.js b/data/js/script.js index cb9afa66c..ffa036280 100644 --- a/data/js/script.js +++ b/data/js/script.js @@ -94,6 +94,21 @@ function fixedEncodeURIComponent (str) { $('.file-upload').bind('change', checkFileUpload); } + $('.text-upload').css('height', '100px'); + $('.text-upload').bind('blur', function() { + $('.text-upload').animate({height: "100px"}, 300); + }); + $('.text-upload').bind('focus', function() { + $('.text-upload').animate({height: "300px"}, 300); + }); + + // work around to submit the form if the click causes the + // textarea to shrink and you can't relase the mouse fast enough + // so mouseup will be outside the button area and not trigger + // submission properly + $('.text-upload-form :submit').bind('mousedown', function() { + $(this).click(); + }); }); })(jQuery); -- cgit v1.2.3-24-g4f1b