From 02ca999af85f9138ab6669dd513fa9c7afc45d44 Mon Sep 17 00:00:00 2001 From: onekiloparsec Date: Thu, 6 Jul 2017 15:16:42 +0200 Subject: [PATCH] ok methods, not computed props Signed-off-by: onekiloparsec --- src/Modal.vue | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Modal.vue b/src/Modal.vue index 4f20e50..d463a31 100644 --- a/src/Modal.vue +++ b/src/Modal.vue @@ -220,16 +220,6 @@ } }, - trueModalWidth () { - const {window, modal} = this - return (typeof modal.width === 'string') ? window.width * parseFloat(modal.width) / 100.0 : modal.width - }, - - trueModalHeight () { - const {window, modal} = this - return (typeof modal.height === 'string') ? window.height * parseFloat(modal.height) / 100.0 : modal.height - }, - modalClass () { return ['v--modal-box', this.classes] }, @@ -270,7 +260,7 @@ this.modal.width = inRange( 0, this.window.width * this.maxAdaptiveWidth, - this.trueModalWidth) + this.trueModalWidth()) this.modal.height = inRange( 0, this.window.height * this.maxAdaptiveHeight, @@ -278,6 +268,15 @@ } }, + trueModalWidth () { + const {window, modal} = this + return (typeof modal.width === 'string') ? window.width * parseFloat(modal.width) / 100.0 : modal.width + }, + + trueModalHeight () { + const {window, modal} = this + return (typeof modal.height === 'string') ? window.height * parseFloat(modal.height) / 100.0 : modal.height + }, isPercentage (string) { return string.splice(-1) === '%' && !isNaN(parseFloat(string))