mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-03 01:09:39 +01:00
fb6bed81c7
git-svn-id: http://svn.automattic.com/wordpress/trunk@17326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
56 lines
1.3 KiB
JavaScript
56 lines
1.3 KiB
JavaScript
var ThemeViewer;
|
|
|
|
(function($){
|
|
ThemeViewer = function( args ) {
|
|
|
|
function init() {
|
|
$( '#filter-click, #mini-filter-click' ).unbind( 'click' ).click( function() {
|
|
$( '#filter-click' ).toggleClass( 'current' );
|
|
$( '#filter-box' ).slideToggle();
|
|
$( '#current-theme' ).slideToggle( 300 );
|
|
return false;
|
|
});
|
|
|
|
$( '#filter-box :checkbox' ).unbind( 'click' ).click( function() {
|
|
var count = $( '#filter-box :checked' ).length,
|
|
text = $( '#filter-click' ).text();
|
|
|
|
if ( text.indexOf( '(' ) != -1 )
|
|
text = text.substr( 0, text.indexOf( '(' ) );
|
|
|
|
if ( count == 0 )
|
|
$( '#filter-click' ).text( text );
|
|
else
|
|
$( '#filter-click' ).text( text + ' (' + 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
|
|
var api = {
|
|
init: init
|
|
};
|
|
|
|
return api;
|
|
}
|
|
})(jQuery);
|
|
|
|
jQuery( document ).ready( function($) {
|
|
theme_viewer = new ThemeViewer();
|
|
theme_viewer.init();
|
|
});
|