summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-06-01 15:52:52 -0400
committerRobin Millette <millette@controlyourself.ca>2009-06-01 15:52:52 -0400
commit0cbd72e0927cbe9b605e34d7bbd86d2046ea0c49 (patch)
treef5950ae0453d0d47dc9f9dc6cac4c99f019b2167
parent4bd195b80f1bf9f7da11ed8cc14a0027228f733e (diff)
Re-added some javascript to toggle upload field.
-rw-r--r--js/util.js11
-rw-r--r--lib/noticeform.php1
2 files changed, 12 insertions, 0 deletions
diff --git a/js/util.js b/js/util.js
index 20f17f6e7..acf44a17c 100644
--- a/js/util.js
+++ b/js/util.js
@@ -17,6 +17,17 @@
*/
$(document).ready(function(){
+ $('input#notice_data-attach').toggle();
+ $('label[for=notice_data-attach]').text('Upload a file as an attachment?');
+ $('label[for=notice_data-attach]').click(function () {
+ if ('Upload a file as an attachment?' == $(this).text()) {
+ $(this).text('Upload: ');
+ $('input#notice_data-attach').slideDown('fast');
+ } else {
+ $('input#notice_data-attach').slideUp('fast', function() {$('label[for=notice_data-attach]').text('Upload a file as an attachment?');});
+ }
+ });
+
$('a.attachment').click(function() {$().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; });
$("a.thumbnail").hover(
function() {
diff --git a/lib/noticeform.php b/lib/noticeform.php
index 5a6c7cf38..805cd56b1 100644
--- a/lib/noticeform.php
+++ b/lib/noticeform.php
@@ -148,6 +148,7 @@ class NoticeForm extends Form
$this->out->element('dd', array('id' => 'notice_text-count'),
'140');
$this->out->elementEnd('dl');
+ $this->out->element('br', array('style' => 'clear:both'));
$this->out->element('label', array('for' => 'notice_data-attach'), _('Attach'));
$this->out->element('input', array('id' => 'notice_data-attach',
'type' => 'file',