From 038493d52b3fb0a1f1460fa48356f15a2f4bcb4f Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 2 Jan 2012 19:46:08 +0530 Subject: [PATCH] fix collapsepanel --- source/Ox.UI/js/Panel/Ox.CollapsePanel.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Panel/Ox.CollapsePanel.js b/source/Ox.UI/js/Panel/Ox.CollapsePanel.js index df349add..b933bbda 100644 --- a/source/Ox.UI/js/Panel/Ox.CollapsePanel.js +++ b/source/Ox.UI/js/Panel/Ox.CollapsePanel.js @@ -88,13 +88,16 @@ Ox.CollapsePanel = function(options, self) { 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(); + if (!self.options.collapsed) { + that.css({ + marginTop: -that.$content.height() + 'px' + }); + that.$content.show(); + } that.$content.animate({ marginTop: marginTop + 'px' }, 250, function() { - self.options.collapsed && that.hide(); + self.options.collapsed && that.$content.hide(); }); that.triggerEvent('toggle', { collapsed: self.options.collapsed