]> code.citadel.org Git - citadel.git/blobdiff - webcit/static/t/edit_message.html
Attachments count is now updated in navbar
[citadel.git] / webcit / static / t / edit_message.html
index 2a07b04ddcf994f62334623ab2abd1268f7386d7..2e432d38920c66bdc27b5f5a7dda267ee92c8546 100644 (file)
        <a href="javascript:show_attachments_form();">
                <img src="static/diskette_24x.gif" alt="" width="24" height="24">
                <span class="navbar_link">
-               <?_("Attach")>
+               <?_("Attachments:")>
+               <span id="num_attachments">0</span>
                </span>
        </a>
 </li>
 
        function hide_attachments_form() {
                $('attachments_form').style.display = 'none';
+               update_attachment_count();
        }
 
        function show_attachments_form() {
                $('attachments_form').style.display = 'block';
 
-               p = 'template=attachments_pane&r=' + CtdlRandomString();
+               p = 'template=edit_message_attachments_pane&r=' + CtdlRandomString();
                new Ajax.Updater(
                        'attachments_form',
                        'do_template',
                );
        }
 
+       function update_attachment_count() {
+               p = 'r=' + CtdlRandomString();
+               new Ajax.Updater(
+                       'num_attachments',
+                       'show_num_attachments',
+                       {
+                               method: 'get',
+                               parameters: p
+                       }
+               );
+       }
+
 </script>
 </div>
 </div>