@@ -113,8 +113,8 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
113
113
114
114
private var header : DisplayObject ;
115
115
private var headerMeasurements : Measurements = new Measurements ();
116
-
117
- private var _ignoreHeaderEvents : Bool = false ;
116
+ private var _ignoreHeaderInteractiveEvents : Bool = false ;
117
+ private var _ignoreHeaderResize : Bool = false ;
118
118
119
119
private var _currentScrollRect : Rectangle ;
120
120
private var _scrollRect1 : Rectangle = new Rectangle ();
@@ -447,6 +447,8 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
447
447
}
448
448
449
449
private function measure (): Bool {
450
+ var oldIgnoreHeaderResize = this ._ignoreHeaderResize ;
451
+ this ._ignoreHeaderResize = true ;
450
452
var measureHeader : IMeasureObject = null ;
451
453
if ((this .header is IMeasureObject )) {
452
454
measureHeader = cast this .header ;
@@ -456,8 +458,12 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
456
458
if ((this .header is IValidating )) {
457
459
(cast this .header : IValidating ).validateNow ();
458
460
}
461
+ this ._ignoreHeaderResize = oldIgnoreHeaderResize ;
462
+
459
463
var measureContent : IMeasureObject = null ;
460
464
if (this ._content != null ) {
465
+ var oldIgnoreContentResize = this ._ignoreContentResize ;
466
+ this ._ignoreContentResize = true ;
461
467
if ((this ._content is IMeasureObject )) {
462
468
measureContent = cast this ._content ;
463
469
}
@@ -466,6 +472,7 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
466
472
if ((this ._content is IValidating )) {
467
473
(cast this ._content : IValidating ).validateNow ();
468
474
}
475
+ this ._ignoreContentResize = oldIgnoreContentResize ;
469
476
}
470
477
471
478
this ._measuredOpenHeight = this .header .height ;
@@ -541,14 +548,14 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
541
548
this ._collapseActuator = null ;
542
549
FeathersEvent .dispatch (this , Event .CANCEL );
543
550
}
544
- var oldIgnoreHeaderEvents = this ._ignoreHeaderEvents ;
545
- this ._ignoreHeaderEvents = true ;
551
+ var oldIgnoreHeaderInteractiveEvents = this ._ignoreHeaderInteractiveEvents ;
552
+ this ._ignoreHeaderInteractiveEvents = true ;
546
553
if ((this .header is IOpenCloseToggle )) {
547
554
(cast this .header : IOpenCloseToggle ).opened = this ._pendingOpened ;
548
555
} else if ((this .header is IToggle )) {
549
556
(cast this .header : IToggle ).selected = this ._pendingOpened ;
550
557
}
551
- this ._ignoreHeaderEvents = oldIgnoreHeaderEvents ;
558
+ this ._ignoreHeaderInteractiveEvents = oldIgnoreHeaderInteractiveEvents ;
552
559
if (this ._pendingAnimation ) {
553
560
this ._pendingHeight = this .actualHeight ;
554
561
if (this ._pendingOpened ) {
@@ -603,14 +610,14 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
603
610
this ._opened = this ._pendingOpened ;
604
611
this ._pendingOpened = null ;
605
612
} else {
606
- var oldIgnoreHeaderEvents = this ._ignoreHeaderEvents ;
607
- this ._ignoreHeaderEvents = true ;
613
+ var oldIgnoreHeaderInteractiveEvents = this ._ignoreHeaderInteractiveEvents ;
614
+ this ._ignoreHeaderInteractiveEvents = true ;
608
615
if ((this .header is IOpenCloseToggle )) {
609
616
(cast this .header : IOpenCloseToggle ).opened = this ._opened ;
610
617
} else if ((this .header is IToggle )) {
611
618
(cast this .header : IToggle ).selected = this ._opened ;
612
619
}
613
- this ._ignoreHeaderEvents = oldIgnoreHeaderEvents ;
620
+ this ._ignoreHeaderInteractiveEvents = oldIgnoreHeaderInteractiveEvents ;
614
621
if (this ._content != null ) {
615
622
this ._content .visible = this ._opened ;
616
623
}
@@ -710,21 +717,21 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
710
717
}
711
718
712
719
private function collapsible_header_openHandler (event : Event ): Void {
713
- if (this ._ignoreHeaderEvents ) {
720
+ if (this ._ignoreHeaderInteractiveEvents ) {
714
721
return ;
715
722
}
716
723
this .openContent (true );
717
724
}
718
725
719
726
private function collapsible_header_closeHandler (event : Event ): Void {
720
- if (this ._ignoreHeaderEvents ) {
727
+ if (this ._ignoreHeaderInteractiveEvents ) {
721
728
return ;
722
729
}
723
730
this .closeContent (true );
724
731
}
725
732
726
733
private function collapsible_header_changeHandler (event : Event ): Void {
727
- if (this ._ignoreHeaderEvents ) {
734
+ if (this ._ignoreHeaderInteractiveEvents ) {
728
735
return ;
729
736
}
730
737
var toggleHeader : IToggle = cast header ;
@@ -736,7 +743,7 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
736
743
}
737
744
738
745
private function collapsible_header_triggerHandler (event : TriggerEvent ): Void {
739
- if (this ._ignoreHeaderEvents ) {
746
+ if (this ._ignoreHeaderInteractiveEvents ) {
740
747
return ;
741
748
}
742
749
if (this ._opened ) {
@@ -747,7 +754,7 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
747
754
}
748
755
749
756
private function collapsible_header_clickHandler (event : MouseEvent ): Void {
750
- if (this ._ignoreHeaderEvents ) {
757
+ if (this ._ignoreHeaderInteractiveEvents ) {
751
758
return ;
752
759
}
753
760
if (this ._opened ) {
@@ -758,6 +765,9 @@ class Collapsible extends FeathersControl implements IOpenCloseToggle {
758
765
}
759
766
760
767
private function collapsible_content_resizeHandler (event : Event ): Void {
768
+ if (this ._ignoreContentResize ) {
769
+ return ;
770
+ }
761
771
setInvalid (LAYOUT );
762
772
}
763
773
}
0 commit comments