@@ -31,7 +31,7 @@ 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 :KnockoutObservable < boolean > = ko . observable ( false ) ;
34
+ public snapshot : boolean ;
35
35
public isFullScreen : KnockoutObservable < boolean > = ko . observable ( false ) ;
36
36
public isSnapshot : KnockoutObservable < boolean > = ko . observable ( false ) ;
37
37
public isSnapshotTransition : KnockoutObservable < boolean > = ko . observable ( false ) ;
@@ -51,7 +51,7 @@ export default class PageBuilder implements PageBuilderInterface {
51
51
this . isFullScreen ( config . isFullScreen ) ;
52
52
this . isSnapshot ( config . pagebuilder_content_snapshot ) ;
53
53
this . isSnapshotTransition ( false ) ;
54
- this . snapshot ( config . pagebuilder_content_snapshot ) ;
54
+ this . snapshot = config . pagebuilder_content_snapshot ;
55
55
this . config = config ;
56
56
57
57
this . isAllowedTemplateApply = isAllowed ( resources . TEMPLATE_APPLY ) ;
@@ -111,17 +111,17 @@ export default class PageBuilder implements PageBuilderInterface {
111
111
* screen.
112
112
*/
113
113
const xPosition = parseInt ( stageWrapper . offset ( ) . top . toString ( ) , 10 ) -
114
- parseInt ( $ ( window ) . scrollTop ( ) . toString ( ) , 10 ) - ( this . snapshot ( ) ? 63 : 0 ) ;
115
- const yPosition = stageWrapper . offset ( ) . left - ( this . snapshot ( ) ? 150 : 0 ) ;
114
+ parseInt ( $ ( window ) . scrollTop ( ) . toString ( ) , 10 ) - ( this . snapshot ? 63 : 0 ) ;
115
+ const yPosition = stageWrapper . offset ( ) . left - ( this . snapshot ? 150 : 0 ) ;
116
116
this . previousStyles = {
117
- position : this . snapshot ( ) ? "relative" : "fixed" ,
117
+ position : this . snapshot ? "relative" : "fixed" ,
118
118
top : `${ xPosition } px` ,
119
119
left : `${ yPosition } px` ,
120
120
zIndex : "800" ,
121
121
width : stageWrapper . outerWidth ( ) . toString ( ) + "px" ,
122
122
} ;
123
123
this . isFullScreen ( true ) ;
124
- if ( this . snapshot ( ) ) {
124
+ if ( this . snapshot ) {
125
125
this . isSnapshot ( false ) ;
126
126
this . stageStyles ( this . previousStyles ) ;
127
127
} else {
@@ -131,7 +131,7 @@ export default class PageBuilder implements PageBuilderInterface {
131
131
_ . defer ( ( ) => {
132
132
// Remove all styles we applied to fix the position once we're transitioning
133
133
panel . css ( "height" , "" ) ;
134
- if ( this . snapshot ( ) ) {
134
+ if ( this . snapshot ) {
135
135
this . stageStyles ( Object . keys ( this . previousStyles )
136
136
. reduce ( ( object : object , styleName : string ) => {
137
137
return Object . assign ( object , { [ styleName ] : "" } ) ;
@@ -147,7 +147,7 @@ export default class PageBuilder implements PageBuilderInterface {
147
147
} ) ;
148
148
} else {
149
149
// When leaving full screen mode just transition back to the original state
150
- if ( this . snapshot ( ) ) {
150
+ if ( this . snapshot ) {
151
151
this . isSnapshotTransition ( true ) ;
152
152
this . stageStyles ( this . previousStyles )
153
153
} else {
@@ -156,7 +156,7 @@ export default class PageBuilder implements PageBuilderInterface {
156
156
panel . css ( "height" , this . previousPanelHeight + "px" ) ;
157
157
// Wait for the 350ms animation to complete before changing these properties back
158
158
_ . delay ( ( ) => {
159
- if ( this . snapshot ( ) ) {
159
+ if ( this . snapshot ) {
160
160
this . isSnapshot ( true ) ;
161
161
this . isSnapshotTransition ( false ) ;
162
162
this . stageStyles ( Object . keys ( this . previousStyles )
0 commit comments