@@ -119,7 +119,7 @@ function getDefaultDescriptionSetting(isAdvanced?: boolean) {
119
119
return result ;
120
120
}
121
121
122
- function getHorizontalAlignment ( questionName : string , defaultValue : string ) : IJsonPropertyInfo {
122
+ function getHorizontalAlignment ( questionName : string ) : IJsonPropertyInfo {
123
123
return < IJsonPropertyInfo > {
124
124
type : "buttongroup" ,
125
125
name : questionName ,
@@ -129,10 +129,10 @@ function getHorizontalAlignment(questionName: string, defaultValue: string): IJs
129
129
{ value : "center" } ,
130
130
{ value : "right" , } ,
131
131
] ,
132
- default : defaultValue ,
132
+ defaultFunc : ( ) => Serializer . getProperty ( "cover" , questionName ) . defaultValue ,
133
133
} ;
134
134
}
135
- function getVerticalAlignment ( questionName : string , defaultValue : string ) : IJsonPropertyInfo {
135
+ function getVerticalAlignment ( questionName : string ) : IJsonPropertyInfo {
136
136
return < IJsonPropertyInfo > {
137
137
type : "buttongroup" ,
138
138
name : questionName ,
@@ -143,7 +143,7 @@ function getVerticalAlignment(questionName: string, defaultValue: string): IJson
143
143
{ value : "middle" } ,
144
144
{ value : "bottom" } ,
145
145
] ,
146
- default : defaultValue ,
146
+ defaultFunc : ( ) => Serializer . getProperty ( "cover" , questionName ) . defaultValue ,
147
147
} ;
148
148
}
149
149
@@ -163,7 +163,7 @@ Serializer.addClass(
163
163
type : "buttongroup" ,
164
164
name : "logoPosition" ,
165
165
visibleIf : ( obj ) => obj . headerView === "basic" ,
166
- default : "left" ,
166
+ defaultFunc : ( ) => Serializer . getProperty ( "survey" , "logoPosition" ) . defaultValue ,
167
167
choices : [
168
168
{ value : "left" } ,
169
169
{ value : "right" }
@@ -173,7 +173,7 @@ Serializer.addClass(
173
173
type : "spinedit" ,
174
174
name : "height" ,
175
175
visibleIf : ( obj ) => obj . headerView === "advanced" ,
176
- default : 0 ,
176
+ defaultFunc : ( ) => Serializer . getProperty ( "cover" , "height" ) . defaultValue ,
177
177
onPropertyEditorUpdate : function ( obj : any , editor : any ) {
178
178
if ( ! ! editor ) {
179
179
editor . unit = "px" ;
@@ -185,7 +185,7 @@ Serializer.addClass(
185
185
type : "spinedit" ,
186
186
name : "mobileHeight" ,
187
187
visibleIf : ( obj ) => obj . headerView === "advanced" ,
188
- default : 0 ,
188
+ defaultFunc : ( ) => Serializer . getProperty ( "cover" , "mobileHeight" ) . defaultValue ,
189
189
onPropertyEditorUpdate : function ( obj : any , editor : any ) {
190
190
if ( ! ! editor ) {
191
191
editor . unit = "px" ;
@@ -197,7 +197,7 @@ Serializer.addClass(
197
197
type : "buttongroup" ,
198
198
name : "inheritWidthFrom" ,
199
199
visibleIf : ( obj ) => obj . headerView === "advanced" ,
200
- default : "survey" ,
200
+ defaultFunc : ( ) => Serializer . getProperty ( "cover" , "inheritWidthFrom" ) . defaultValue ,
201
201
choices : [
202
202
{ value : "survey" } ,
203
203
{ value : "container" }
@@ -207,7 +207,7 @@ Serializer.addClass(
207
207
type : "spinedit" ,
208
208
name : "textAreaWidth" ,
209
209
visibleIf : ( obj ) => obj . headerView === "advanced" ,
210
- default : 0 ,
210
+ defaultFunc : ( ) => Serializer . getProperty ( "cover" , "textAreaWidth" ) . defaultValue ,
211
211
onPropertyEditorUpdate : function ( obj : any , editor : any ) {
212
212
if ( ! ! editor ) {
213
213
editor . unit = "px" ;
@@ -260,7 +260,7 @@ Serializer.addClass(
260
260
{ value : "contain" } ,
261
261
{ value : "tile" } ,
262
262
] ,
263
- default : "cover" ,
263
+ defaultFunc : ( ) => Serializer . getProperty ( "cover" , "backgroundImageFit" ) . defaultValue ,
264
264
visibleIf : ( obj ) => obj . headerView === "advanced" ,
265
265
onPropertyEditorUpdate : function ( obj : any , editor : any ) {
266
266
if ( ! ! editor ) {
@@ -272,7 +272,13 @@ Serializer.addClass(
272
272
type : "spinedit" ,
273
273
name : "backgroundImageOpacity" ,
274
274
visibleIf : ( obj ) => obj . headerView === "advanced" ,
275
- default : 100 ,
275
+ defaultFunc : ( ) => {
276
+ const defaultValue = Serializer . getProperty ( "cover" , "backgroundImageOpacity" ) . defaultValue ;
277
+ if ( defaultValue !== undefined && defaultValue !== null ) {
278
+ return defaultValue * 100 ;
279
+ }
280
+ return defaultValue ;
281
+ } ,
276
282
onPropertyEditorUpdate : function ( obj : any , editor : any ) {
277
283
if ( ! ! editor ) {
278
284
editor . unit = "%" ;
@@ -296,12 +302,12 @@ Serializer.addClass(
296
302
}
297
303
} ,
298
304
299
- getHorizontalAlignment ( "logoPositionX" , "left" ) ,
300
- getVerticalAlignment ( "logoPositionY" , "bottom" ) ,
301
- getHorizontalAlignment ( "titlePositionX" , "left" ) ,
302
- getVerticalAlignment ( "titlePositionY" , "bottom" ) ,
303
- getHorizontalAlignment ( "descriptionPositionX" , "left" ) ,
304
- getVerticalAlignment ( "descriptionPositionY" , "bottom" ) ,
305
+ getHorizontalAlignment ( "logoPositionX" ) ,
306
+ getVerticalAlignment ( "logoPositionY" ) ,
307
+ getHorizontalAlignment ( "titlePositionX" ) ,
308
+ getVerticalAlignment ( "titlePositionY" ) ,
309
+ getHorizontalAlignment ( "descriptionPositionX" ) ,
310
+ getVerticalAlignment ( "descriptionPositionY" ) ,
305
311
] ) ;
306
312
307
313
Serializer . addProperties ( "header" , [
0 commit comments