diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-25 14:02:41 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-25 14:02:41 -0700 |
commit | b53b6b8769d5531c16ba58d4560119bcee8b39ff (patch) | |
tree | 69524e7f95d68fde05ffa91cf9d4106f37682e5a /js/util.js | |
parent | a7cdf32df541bf73a47f1255b3e9f0a22c4724b4 (diff) | |
parent | e268cb5fd1a81835180a0f6190b7929d03ce42d7 (diff) |
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/js/util.js b/js/util.js index 9156045bb..e7c54b74a 100644 --- a/js/util.js +++ b/js/util.js @@ -222,6 +222,7 @@ $(document).ready(function(){ } $("#notice_data-text").val(""); $("#notice_data-attach").val(""); + $('#notice_data-attach_selected').remove(); counter(); } $("#form_notice").removeClass("processing"); @@ -233,7 +234,7 @@ $(document).ready(function(){ $("#form_notice").each(addAjaxHidden); NoticeReply(); NoticeAttachments(); - NoticeDataAttachSelected(); + NoticeDataAttach(); }); function NoticeReply() { @@ -312,10 +313,15 @@ function NoticeAttachments() { ); } -function NoticeDataAttachSelected() { - $('#notice_data-attach').change(function() { - S = '<div id="notice_data-attach_selected" class="success">'+$(this).val()+'</div>'; +function NoticeDataAttach() { + NDA = $('#notice_data-attach'); + NDA.change(function() { + S = '<div id="notice_data-attach_selected" class="success"><code>'+$(this).val()+'</code> <button>×</button></div>'; NDAS = $('#notice_data-attach_selected'); (NDAS.length > 0) ? NDAS.replaceWith(S) : $('#form_notice').append(S); + $('#notice_data-attach_selected button').click(function(){ + $('#notice_data-attach_selected').remove(); + NDA.val(''); + }); }); } |