Fixes display of removed redirection.
[platal.git] / templates / emails / send.tpl
index a8628b4..1434bc5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -65,7 +65,7 @@
     for (var i = 0 ; i < form['cc_contacts[]'].length ; ++i) {
       ccc += form['cc_contacts[]'].options[i].value + ";";
     }
-    $.post(platal_baseurl + "emails/send",
+    $.xpost("emails/send",
            { save: true,
              token: '{xsrf_token}',
              from: form.from.value,
       saveMessage();
       return true;
     });
-  $(document).ready(
+  $(
     function() {
       // Remove empty options in select (they were added only for HTML
       // compatibility).
       $('#to_contacts option[value=""]').remove();
       $('#cc_contacts option[value=""]').remove();
     });
+
+    $(function() {
+      $("[name='to']").focus();
+    });
   {/literal}
 //]]>
 </script>
       {literal}
       function removeAttachments()
       {
-          Ajax.update_html(null, 'emails/send', null);
-          document.getElementById('att_already').style.display = 'none';
-          document.getElementById('att_form').style.display = '';
+          $.xget('email/send');
+          $('#att_already').hide();
+          $('#att_form').show();
       }
       {/literal}
     //]]></script>