From 0c6541363de6a916e182a77cfe3d2c08c1c48aa7 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 2 Jan 2012 14:25:04 +0000 Subject: [PATCH] fix collapsepanel --- source/Ox.UI/js/Panel/Ox.CollapsePanel.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/Ox.UI/js/Panel/Ox.CollapsePanel.js b/source/Ox.UI/js/Panel/Ox.CollapsePanel.js index b933bbda..8d17b3c4 100644 --- a/source/Ox.UI/js/Panel/Ox.CollapsePanel.js +++ b/source/Ox.UI/js/Panel/Ox.CollapsePanel.js @@ -73,7 +73,7 @@ Ox.CollapsePanel = function(options, self) { if (self.options.collapsed) { that.$content.css({ marginTop: -that.$content.height() + 'px' - }); + }).hide(); } function doubleclickTitlebar(e) { @@ -88,12 +88,9 @@ Ox.CollapsePanel = function(options, self) { var marginTop; self.options.collapsed = !self.options.collapsed; marginTop = self.options.collapsed ? -that.$content.height() : 0; - if (!self.options.collapsed) { - that.css({ - marginTop: -that.$content.height() + 'px' - }); - that.$content.show(); - } + !self.options.collapsed && that.$content.css({ + marginTop: -that.$content.height() + 'px' + }).show(); that.$content.animate({ marginTop: marginTop + 'px' }, 250, function() {