]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added functionality to remove the notice data attachment
authorSarven Capadisli <csarven@controlyourself.ca>
Thu, 25 Jun 2009 21:01:07 +0000 (21:01 +0000)
committerSarven Capadisli <csarven@controlyourself.ca>
Thu, 25 Jun 2009 21:01:07 +0000 (21:01 +0000)
js/util.js
theme/base/css/display.css

index 9156045bbf025e4f53ad2b235342a26fbd7275b7..e7c54b74accb245d8397105efe30cd3af19ecb67 100644 (file)
@@ -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>&#215;</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('');
+        });
     });
 }
index c8f23e4f5630efdfaec1162842fba8f188e98920..78fcd7ecefcca0187e3a620f6dcd6eb8c4cf4d91 100644 (file)
@@ -517,8 +517,19 @@ clear:both;
 width:81.5%;
 margin-bottom:0;
 line-height:1.618;
+}
+#form_notice #notice_data-attach_selected code {
+float:left;
+width:90%;
+display:block;
+font-size:1.1em;
+line-height:1.8;
 overflow:auto;
 }
+#form_notice #notice_data-attach_selected button {
+float:right;
+font-size:0.8em;
+}
 
 /* entity_profile */
 .entity_profile {