Skip to content

Instantly share code, notes, and snippets.

Created May 22, 2011 08:56
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jjdelc/985283 to your computer and use it in GitHub Desktop.
Save jjdelc/985283 to your computer and use it in GitHub Desktop.
Collapse list_filter in Django admin
ListFilterCollapsePrototype = {
bindToggle: function(){
var that = this;
init: function(filterEl) {
this.$filterEl = $(filterEl).css('cursor', 'pointer');
this.$filterList = this.$'ul').hide();
function ListFilterCollapse(filterEl) {
ListFilterCollapse.prototype = ListFilterCollapsePrototype;
var collapser = new ListFilterCollapse(this);
Copy link

lindyang commented Oct 5, 2013

hello,I've use the js,and it works well.But if I want this kind of effect:when I refresh my django admin site,the list_filter can collapse while not wide.In which place of the js code should be change.

Copy link

I wrote a snippets for menu collapse and single element menu collapse.

It's a fork from abyx code, I've just extended it.

If a filter was previously activated the element menu related to this will start as opened.

The filter menu starts closed as default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment