Index: trunk/extensions/Reviews/resources/reviews.display.js |
— | — | @@ -22,14 +22,22 @@ |
23 | 23 | |
24 | 24 | review.remove( function( success ) { |
25 | 25 | if ( success ) { |
26 | | - $this.closest( 'table' ).closest( 'tr' ).slideUp( 'slow', function() { |
27 | | - $this.remove(); |
28 | | - } ); |
| 26 | + $tr = $this.closest( 'table' ).closest( 'tr' ); |
| 27 | + |
| 28 | + if ( $( '.reviews-pager-table > tr' ).length > 1 ) { |
| 29 | + $tr.slideUp( 'slow', function() { $tr.remove(); } ); |
| 30 | + } |
| 31 | + else { |
| 32 | + $table = $tr.closest( 'table' ); |
| 33 | + $table.slideUp( 'slow', function() { |
| 34 | + $table.remove(); |
| 35 | + $( '#reviewslist' ).remove(); |
| 36 | + } ); |
| 37 | + } |
29 | 38 | } |
30 | 39 | else { |
31 | 40 | // TODO |
32 | 41 | alert( 'The review could not be removed.' ); |
33 | | - $this.button( 'enable' ); |
34 | 42 | } |
35 | 43 | } ); |
36 | 44 | } |