Skip to content

Instantly share code, notes, and snippets.

@channprj
Last active February 29, 2024 20:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save channprj/81b26a3a169ec29a3d1fd994b9121169 to your computer and use it in GitHub Desktop.
Save channprj/81b26a3a169ec29a3d1fd994b9121169 to your computer and use it in GitHub Desktop.
Toggle Django Admin Filter Panel
(function($) {
$(document).ready(function($) {
$("tr input.action-select").actions();
$('<div id="show-filters" style="float: right;"><a href="#">&larr; 필터 보기</a></p>').prependTo('div.actions');
$('#show-filters').hide();
$('#changelist-filter h2').html('<a style="color: white;" id="hide-filters" href="#">필터 &rarr;</a>');
$('#show-filters').click(function() {
$('#changelist-filter').show('fast');
$('#changelist').addClass('filtered');
$('#show-filters').hide();
});
$('#hide-filters').click( function() {
$('#changelist-filter').hide('fast');
$('#show-filters').show();
$('#changelist').removeClass('filtered');
});
});
})(django.jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment