forked from 0x2620/oxjs
misc fixes
This commit is contained in:
parent
7ca9a4a9e7
commit
b77852296b
7 changed files with 28 additions and 44 deletions
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue