X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3b1ea255664edd2deef17f900a655613d20820d..a6444c710cf37d7732aea76e752e43322b5036ca:/wp-includes/js/wp-lists.dev.js diff --git a/wp-includes/js/wp-lists.dev.js b/wp-includes/js/wp-lists.dev.js index ae17fc62..78aa4b4c 100644 --- a/wp-includes/js/wp-lists.dev.js +++ b/wp-includes/js/wp-lists.dev.js @@ -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; }