@@ -31,7 +31,6 @@ export default class PageBuilder implements PageBuilderInterface {
31
31
public initialValue : string ;
32
32
public id : string = utils . uniqueid ( ) ;
33
33
public originalScrollTop : number = 0 ;
34
- public snapshot : boolean ;
35
34
public isFullScreen : KnockoutObservable < boolean > = ko . observable ( false ) ;
36
35
public isSnapshot : KnockoutObservable < boolean > = ko . observable ( false ) ;
37
36
public isSnapshotTransition : KnockoutObservable < boolean > = ko . observable ( false ) ;
@@ -42,6 +41,7 @@ export default class PageBuilder implements PageBuilderInterface {
42
41
public isAllowedTemplateApply : boolean ;
43
42
private previousStyles : { [ key : string ] : string } = { } ;
44
43
private previousPanelHeight : number ;
44
+ private snapshot : boolean ;
45
45
46
46
constructor ( config : any , initialValue : string ) {
47
47
Config . setConfig ( config ) ;
@@ -98,10 +98,12 @@ export default class PageBuilder implements PageBuilderInterface {
98
98
this . isFullScreen ( ! this . isFullScreen ( ) ) ;
99
99
return ;
100
100
}
101
+
101
102
const stageWrapper = $ ( "#" + this . stage . id ) . parent ( ) ;
102
103
const pageBuilderWrapper = stageWrapper . parents ( ".pagebuilder-wysiwyg-wrapper" ) ;
103
104
const panel = stageWrapper . find ( ".pagebuilder-panel" ) ;
104
105
stageWrapper . scrollTop ( 0 ) ;
106
+
105
107
if ( ! this . isFullScreen ( ) ) {
106
108
pageBuilderWrapper . css ( "height" , pageBuilderWrapper . outerHeight ( ) ) ;
107
109
this . previousPanelHeight = panel . outerHeight ( ) ;
@@ -120,14 +122,15 @@ export default class PageBuilder implements PageBuilderInterface {
120
122
zIndex : "800" ,
121
123
width : stageWrapper . outerWidth ( ) . toString ( ) + "px" ,
122
124
} ;
123
- this . isFullScreen ( true ) ;
125
+
124
126
if ( this . snapshot ) {
125
127
this . isSnapshot ( false ) ;
126
128
this . stageStyles ( this . previousStyles ) ;
127
129
} else {
128
130
this . wrapperStyles ( this . previousStyles ) ;
129
131
}
130
132
133
+ this . isFullScreen ( true ) ;
131
134
_ . defer ( ( ) => {
132
135
// Remove all styles we applied to fix the position once we're transitioning
133
136
panel . css ( "height" , "" ) ;
@@ -152,7 +155,9 @@ export default class PageBuilder implements PageBuilderInterface {
152
155
this . stageStyles ( this . previousStyles )
153
156
} else {
154
157
this . wrapperStyles ( this . previousStyles ) ;
158
+ this . isFullScreen ( false ) ;
155
159
}
160
+
156
161
panel . css ( "height" , this . previousPanelHeight + "px" ) ;
157
162
// Wait for the 350ms animation to complete before changing these properties back
158
163
_ . delay ( ( ) => {
@@ -164,14 +169,15 @@ export default class PageBuilder implements PageBuilderInterface {
164
169
return Object . assign ( object , { [ styleName ] : "" } ) ;
165
170
} , { } ) ,
166
171
) ;
172
+ this . isFullScreen ( false ) ;
167
173
} else {
168
174
this . wrapperStyles ( Object . keys ( this . previousStyles )
169
175
. reduce ( ( object : object , styleName : string ) => {
170
176
return Object . assign ( object , { [ styleName ] : "" } ) ;
171
177
} , { } ) ,
172
178
) ;
173
179
}
174
- this . isFullScreen ( false ) ;
180
+
175
181
panel . css ( "height" , "" ) ;
176
182
pageBuilderWrapper . css ( "height" , "" ) ;
177
183
this . previousStyles = { } ;
0 commit comments