Added maxAdaprive(Width/Height) props

This commit is contained in:
euvl
2017-06-05 16:50:21 +01:00
parent a12d9aefee
commit 082f70477b

View File

@@ -69,6 +69,20 @@
type: Number, type: Number,
default: 0 default: 0
}, },
adaptiveMaxWidth: {
type: Number,
default: 1,
validator (value) {
return value > 0 && value <= 1
}
},
adaptiveMaxHeight: {
type: Number,
default: 1,
validator (value) {
return value > 0 && value <= 1
}
}
width: { width: {
type: Number, type: Number,
default: 600 default: 600
@@ -219,8 +233,14 @@
adaptSize () { adaptSize () {
if (this.adaptive) { if (this.adaptive) {
this.modal.width = inRange(0, this.window.width, this.modal.width) this.modal.width = inRange(
this.modal.height = inRange(0, this.window.height, this.modal.height) 0,
this.window.width * this.maxAdaptiveWidth,
this.modal.width)
this.modal.height = inRange(
0,
this.window.height * this.maxAdaptiveWidth,
this.modal.height)
} }
}, },