Ajaxify theme feature filter. Props ocean90 for initial patch. See #14936

git-svn-id: http://svn.automattic.com/wordpress/trunk@16553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu
2010-11-23 20:17:22 +00:00
parent 3230b44f63
commit c891b0ebc7
4 changed files with 33 additions and 18 deletions
+18 -3
View File
@@ -4,7 +4,7 @@ var ThemeViewer;
ThemeViewer = function( args ) {
function filter_count() {
var count = $( '#filters :checked' ).length;
var count = $( '#filter-box :checked' ).length;
var text = $( '#filter-click' ).text();
if ( text.indexOf( '(' ) != -1 )
@@ -19,14 +19,29 @@ var ThemeViewer;
function init() {
$( '#filter-click, #mini-filter-click' ).unbind( 'click' ).click( function() {
$( '#filter-click' ).toggleClass( 'current' );
$( '#filters' ).slideToggle();
$( '#filter-box' ).slideToggle();
$( '#current-theme' ).slideToggle( 300 );
return false;
});
$( '#filters :checkbox' ).unbind( 'click' ).click( function() {
$( '#filter-box :checkbox' ).unbind( 'click' ).click( function() {
filter_count();
});
$('#filter-box :submit').unbind( 'click' ).click(function() {
var features = [];
$('#filter-box :checked').each(function() {
features.push($(this).val());
});
listTable.update_rows({'features': features}, true, function() {
$( '#filter-click' ).toggleClass( 'current' );
$( '#filter-box' ).slideToggle();
$( '#current-theme' ).slideToggle( 300 );
});
return false;
});
}
// These are the functions we expose