Skip to content

Commit 28262d4

Browse files
marianokswedberg
authored andcommitted
Add afterCollapse which is called after collapsing effect completes
1 parent 55d190a commit 28262d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jquery.expander.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
onSlice: null, // function() {}
6868
beforeExpand: null, // function() {},
6969
afterExpand: null, // function() {},
70-
onCollapse: null // function(byUser) {}
70+
onCollapse: null, // function(byUser) {}
71+
afterCollapse: null // function() {}
7172
}
7273
};
7374

@@ -127,7 +128,7 @@
127128
$.data(this, 'expanderInit', true);
128129
$.data(this, 'expander', o);
129130
// determine which callback functions are defined
130-
$.each(['onSlice','beforeExpand', 'afterExpand', 'onCollapse'], function(index, val) {
131+
$.each(['onSlice','beforeExpand', 'afterExpand', 'onCollapse', 'afterCollapse'], function(index, val) {
131132
defined[val] = $.isFunction(o[val]);
132133
});
133134

@@ -385,6 +386,7 @@
385386
el.parent().children('div.' + o.summaryClass).show()
386387
.find('span.' + o.moreClass).show();
387388
}
389+
if (o.afterCollapse) {o.afterCollapse.call(el);}
388390
});
389391
}
390392

0 commit comments

Comments
 (0)