Mailer project rwritten:
[mailer.git] / templates / de / html / js / js_admin_ajax.tpl
index b411d1769dbee70aac4bde1616852760f8267233..f8ddc6275c649ebcd30fb67583facbd250d321b2 100644 (file)
@@ -25,8 +25,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
  * MA  02110-1301  USA
  */
-// Make both windows drag'n'drop-able
-$().ready(function() {
+
+// If all all has been loaded, initialize rest of it
+$().ready(function () {
        // Fade default content in
        window.setTimeout("requestAjaxContent('admin', 'admin_content', '$content[admin_page]', false)", 250);
 
@@ -42,7 +43,7 @@ $().ready(function() {
        $('a').each(function (i) {
                $(this).on('click', {index:i}, function (event) {
                        // Is there a valid index?
-                       if (indexTranslation[event.data.index] != null) {
+                       if (indexTranslation[event.data.index] !== null) {
                                // Prevent default action
                                event.preventDefault();
 
@@ -52,18 +53,8 @@ $().ready(function() {
                });
        });
 
-       //-----------------------------------------
-       //             Close buttons
-       //-----------------------------------------
-       $('#admin_error_close').click(function () {
-               // Close the window
-               closeErrorWindow('admin');
-       });
-
-       $('#admin_warning_close').click(function () {
-               // Close the window
-               closeWarningWindow('admin');
-       });
+       // Register common things (close buttons, drag&drop)
+       registerCommons('admin');
 
        //-----------------------------------------
        //             Save changes
@@ -72,15 +63,4 @@ $().ready(function() {
                // Save changes
                saveChanges('admin');
        });
-
-       //-----------------------------------------
-       //              Drag'N'Drop
-       //-----------------------------------------
-       $('#admin_warning').draggable({
-               opacity: 0.85
-       });
-
-       $('#admin_error').draggable({
-               opacity: 0.85
-       });
 });