mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
@@ -96,7 +96,7 @@
|
|||||||
default: [Number, String],
|
default: [Number, String],
|
||||||
validator (value) {
|
validator (value) {
|
||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
return this.isPercentage(value)
|
return string.splice(-1) === '%' && !isNaN(parseFloat(string))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof value === 'number') {
|
if (typeof value === 'number') {
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
validator (value) {
|
validator (value) {
|
||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
const reg = RegExp('^(\d+|\d+[.]\d+)%?$')
|
const reg = RegExp('^(\d+|\d+[.]\d+)%?$')
|
||||||
return value === 'auto' || this.isPercentage(value)
|
return value === 'auto' || (string.splice(-1) === '%' && !isNaN(parseFloat(string)))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof value === 'number') {
|
if (typeof value === 'number') {
|
||||||
@@ -278,10 +278,6 @@
|
|||||||
return (typeof modal.height === 'string') ? window.height * parseFloat(modal.height) / 100.0 : modal.height
|
return (typeof modal.height === 'string') ? window.height * parseFloat(modal.height) / 100.0 : modal.height
|
||||||
},
|
},
|
||||||
|
|
||||||
isPercentage (string) {
|
|
||||||
return string.splice(-1) === '%' && !isNaN(parseFloat(string))
|
|
||||||
},
|
|
||||||
|
|
||||||
resize (event) {
|
resize (event) {
|
||||||
this.modal.width = event.size.width
|
this.modal.width = event.size.width
|
||||||
this.modal.height = event.size.height
|
this.modal.height = event.size.height
|
||||||
|
|||||||
Reference in New Issue
Block a user