From cb5fe06e58c86655131a0b516295338a8af6900f Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Mon, 8 Dec 2014 15:29:28 -0800 Subject: [PATCH] Fixed: button are always removed from the superview in layoutSubviews Previously, the button of a CPButtonBar were always removed and readded in the method layoutSubviews. Now we only remove the hidden button. --- AppKit/CPButtonBar.j | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AppKit/CPButtonBar.j b/AppKit/CPButtonBar.j index 024924830..47f869597 100644 --- a/AppKit/CPButtonBar.j +++ b/AppKit/CPButtonBar.j @@ -234,10 +234,11 @@ { var button = buttonsNotHidden[count]; - [button removeFromSuperview]; - if ([button isHidden]) + { + [button removeFromSuperview]; [buttonsNotHidden removeObject:button]; + } } var currentButtonOffset = _resizeControlIsLeftAligned ? CGRectGetMaxX([self bounds]) + 1 : -1,