Skip to content

Instantly share code, notes, and snippets.

Created May 22, 2011 08:56
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
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

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