]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/wp-lists.dev.js
Wordpress 2.9
[autoinstalls/wordpress.git] / wp-includes / js / wp-lists.dev.js
index ae17fc62e2dbe29328555bb66a09c58ea4fc436e..78aa4b4c3de87a4c6f76eba2002e1769a4162373 100644 (file)
@@ -3,7 +3,7 @@ var fs = {add:'ajaxAdd',del:'ajaxDel',dim:'ajaxDim',process:'process',recolor:'r
 
 wpList = {
        settings: {
-               url: wpListL10n.url, type: 'POST',
+               url: ajaxurl, type: 'POST',
                response: 'ajax-response',
 
                what: '',
@@ -107,6 +107,7 @@ wpList = {
                                };
                        }
                        list.wpList.recolor();
+                       $(list).trigger( 'wpListAddEnd', [ s, list.wpList ] );
                        wpList.clear.call(list,'#' + s.element);
                };
 
@@ -116,12 +117,12 @@ wpList = {
 
        ajaxDel: function( e, s ) {
                e = $(e); s = s || {};
-               var list = this, cls = wpList.parseClass(e,'delete'), element, anim;
+               var list = this, cls = wpList.parseClass(e,'delete'), element;
                s = wpList.pre.call( list, e, s, 'delete' );
 
                s.element = cls[2] || s.element || null;
                if ( cls[3] ) { s.delColor = '#' + cls[3]; }
-               else { s.delColor = s.delColor || '#FF3333'; }
+               else { s.delColor = s.delColor || '#faa'; }
 
                if ( !s || !s.element ) { return false; }
 
@@ -135,7 +136,7 @@ wpList = {
                );
 
                if ( $.isFunction(s.delBefore) ) {
-                       s = s.delBefore( s );
+                       s = s.delBefore( s, list );
                        if ( !s ) { return true; }
                }
                if ( !s.data._ajax_nonce ) { return true; }
@@ -143,20 +144,19 @@ wpList = {
                element = $('#' + s.element);
 
                if ( 'none' != s.delColor ) {
-                       anim = 'slideUp';
-                       if ( element.css( 'display' ).match(/table/) )
-                               anim = 'fadeOut'; // Can't slideup table rows and other table elements.  Known jQuery bug
-                       element
-                               .animate( { backgroundColor: s.delColor }, 'fast'  )[anim]( 'fast' )
-                               .queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
+                       element.css( 'backgroundColor', s.delColor ).fadeOut( 350, function(){
+                               list.wpList.recolor();
+                               $(list).trigger( 'wpListDelEnd', [ s, list.wpList ] );
+                       });
                } else {
                        list.wpList.recolor();
+                       $(list).trigger( 'wpListDelEnd', [ s, list.wpList ] );
                }
 
                s.success = function(r) {
                        var res = wpAjax.parseAjaxResponse(r, s.response, s.element), o;
                        if ( !res || res.errors ) {
-                               element.stop().stop().css( 'backgroundColor', '#FF3333' ).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
+                               element.stop().stop().css( 'backgroundColor', '#faa' ).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
                                return false;
                        }
                        if ( $.isFunction(s.delAfter) ) {
@@ -213,7 +213,9 @@ wpList = {
                        element
                                .animate( { backgroundColor: dimColor }, 'fast' )
                                .queue( function() { element.toggleClass(s.dimClass); $(this).dequeue(); } )
-                               .animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); } } );
+                               .animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); $(list).trigger( 'wpListDimEnd', [ s, list.wpList ] ); } } );
+               } else {
+                       $(list).trigger( 'wpListDimEnd', [ s, list.wpList ] );
                }
 
                if ( !s.data._ajax_nonce ) { return true; }