1
0
Fork 0
forked from 0x2620/oxjs

misc fixes

This commit is contained in:
rolux 2012-01-02 19:35:14 +05:30
commit b77852296b
7 changed files with 28 additions and 44 deletions

View file

@ -83,12 +83,19 @@ Ox.CollapsePanel = function(options, self) {
}
function toggleCollapsed() {
// show/hide is needed in case the collapsed content
// grows vertically when shrinking the panel horizontally
var marginTop;
self.options.collapsed = !self.options.collapsed;
marginTop = self.options.collapsed ? -that.$content.height() : 0;
!self.options.collapsed && that.css({
marginTop: -that.$content.height() + 'px'
}).show();
that.$content.animate({
marginTop: marginTop + 'px'
}, 200);
}, 250, function() {
self.options.collapsed && that.hide();
});
that.triggerEvent('toggle', {
collapsed: self.options.collapsed
});