Apply preview styles from file page block to module field
This commit is contained in:
@@ -22,12 +22,12 @@ interface FileOptions extends Options {
|
||||
inline: boolean;
|
||||
hideFileName: boolean;
|
||||
mimetypes?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
maxHeight?: number;
|
||||
maxWidth?: number;
|
||||
borderRadius?: number;
|
||||
margin?: number;
|
||||
height?: string;
|
||||
width?: string;
|
||||
maxHeight?: string;
|
||||
maxWidth?: string;
|
||||
borderRadius?: string;
|
||||
margin?: string;
|
||||
backgroundColor?: string;
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ const defaults = (): Readonly<FileOptions> => Object.freeze({
|
||||
inline: true,
|
||||
hideFileName: false,
|
||||
mimetypes: '',
|
||||
height: undefined,
|
||||
width: undefined,
|
||||
maxHeight: undefined,
|
||||
maxWidth: undefined,
|
||||
borderRadius: undefined,
|
||||
margin: undefined,
|
||||
backgroundColor: undefined,
|
||||
height: '',
|
||||
width: '',
|
||||
maxHeight: '',
|
||||
maxWidth: '',
|
||||
borderRadius: '',
|
||||
margin: 'auto',
|
||||
backgroundColor: '',
|
||||
})
|
||||
|
||||
export class ModuleFieldFile extends ModuleField {
|
||||
@@ -63,9 +63,9 @@ export class ModuleFieldFile extends ModuleField {
|
||||
if (!o) return
|
||||
super.applyOptions(o)
|
||||
|
||||
Apply(this.options, o, Number, 'maxSize', 'height', 'width', 'maxHeight', 'maxWidth', 'borderRadius', 'margin')
|
||||
Apply(this.options, o, Number, 'maxSize')
|
||||
Apply(this.options, o, Boolean, 'allowImages', 'allowDocuments', 'inline', 'hideFileName')
|
||||
Apply(this.options, o, String, 'mimetypes', 'backgroundColor')
|
||||
Apply(this.options, o, String, 'mimetypes', 'height', 'width', 'maxHeight', 'maxWidth', 'borderRadius', 'margin', 'backgroundColor')
|
||||
ApplyWhitelisted(this.options, o, modes, 'mode')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user