@@ -98,16 +98,6 @@ export class SurveyElementAdornerBase<T extends SurveyElement = SurveyElement> e
98
98
return this . collapsed && this . creator . dragDropSurveyElements . insideContainer ;
99
99
}
100
100
101
- protected creatorDragStartHandler = ( ) => {
102
- if ( this . surveyElement . isPage ) this . collapsedByDrag = this . creator . collapsePagesOnDragStart ;
103
- if ( this . surveyElement . isPanel ) this . collapsedByDrag = this . creator . collapsePanelsOnDragStart ;
104
- if ( this . surveyElement . isQuestion ) this . collapsedByDrag = this . creator . collapseQuestionsOnDragStart ;
105
- }
106
-
107
- protected creatorDragEndHandler = ( ) => {
108
- this . collapsedByDrag = false ;
109
- }
110
-
111
101
@property ( { defaultValue : true } ) allowExpandCollapse : boolean ;
112
102
@property ( {
113
103
onSet : ( val , target : SurveyElementAdornerBase < T > ) => {
@@ -126,7 +116,7 @@ export class SurveyElementAdornerBase<T extends SurveyElement = SurveyElement> e
126
116
private dragCollapsedTimer ;
127
117
128
118
protected dragIn ( ) {
129
- if ( ( this . surveyElement . isPanel || this . surveyElement . isPage ) && this . calculatedCollapsed ) {
119
+ if ( ( this . surveyElement . isPanel || this . surveyElement . isPage ) && this . collapsed ) {
130
120
this . dragCollapsedTimer = setTimeout ( ( ) => {
131
121
this . expandWithDragIn ( ) ;
132
122
} , this . creator . expandOnDragTimeOut ) ;
@@ -153,11 +143,13 @@ export class SurveyElementAdornerBase<T extends SurveyElement = SurveyElement> e
153
143
protected surveyElement : T
154
144
) {
155
145
super ( ) ;
156
- this . creator . onDragStart . add ( this . creatorDragStartHandler ) ;
157
- this . creator . onDragEnd . add ( this . creatorDragEndHandler ) ;
158
146
this . designerStateManager = ( creator . getPlugin ( "designer" ) as TabDesignerPlugin ) ?. designerStateManager ;
159
147
this . designerStateManager ?. initForElement ( surveyElement ) ;
160
148
this . selectedPropPageFunc = ( sender : Base , options : any ) => {
149
+ // TODO: discuss and check
150
+ if ( options . name === "state" ) {
151
+ this . collapsed = ! this . surveyElement . isExpanded ;
152
+ }
161
153
if ( options . name === "dragTypeOverMe" ) {
162
154
if ( ! ! options . newValue && this . dragInsideCollapsedContainer ) this . dragIn ( ) ; else this . dragOut ( ) ;
163
155
}
0 commit comments