mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Ajaxify theme feature filter. Props ocean90 for initial patch. See #14936
git-svn-id: https://develop.svn.wordpress.org/trunk@16553 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user