2010-09-24 14:50:31 -04:00
|
|
|
var ThemeViewer;
|
|
|
|
|
|
|
|
(function($){
|
|
|
|
ThemeViewer = function( args ) {
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
$( '#filter-click, #mini-filter-click' ).unbind( 'click' ).click( function() {
|
|
|
|
$( '#filter-click' ).toggleClass( 'current' );
|
2010-11-23 15:17:22 -05:00
|
|
|
$( '#filter-box' ).slideToggle();
|
2010-09-24 14:50:31 -04:00
|
|
|
$( '#current-theme' ).slideToggle( 300 );
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2010-11-23 15:17:22 -05:00
|
|
|
$( '#filter-box :checkbox' ).unbind( 'click' ).click( function() {
|
2010-11-23 15:20:44 -05:00
|
|
|
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 + ')' );
|
2010-09-24 14:50:31 -04:00
|
|
|
});
|
2010-11-23 15:17:22 -05:00
|
|
|
|
2011-01-18 12:32:35 -05:00
|
|
|
/* $('#filter-box :submit').unbind( 'click' ).click(function() {
|
2010-11-23 15:17:22 -05:00
|
|
|
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 );
|
|
|
|
});
|
2010-12-13 16:21:50 -05:00
|
|
|
|
2010-11-23 15:17:22 -05:00
|
|
|
return false;
|
2011-01-18 12:32:35 -05:00
|
|
|
}); */
|
2010-09-24 14:50:31 -04:00
|
|
|
}
|
2010-10-21 15:55:28 -04:00
|
|
|
|
2010-09-24 14:50:31 -04:00
|
|
|
// These are the functions we expose
|
|
|
|
var api = {
|
|
|
|
init: init
|
|
|
|
};
|
|
|
|
|
|
|
|
return api;
|
|
|
|
}
|
|
|
|
})(jQuery);
|
|
|
|
|
|
|
|
jQuery( document ).ready( function($) {
|
|
|
|
theme_viewer = new ThemeViewer();
|
|
|
|
theme_viewer.init();
|
2010-11-22 19:06:15 -05:00
|
|
|
});
|