From dbacfa28d191f85b77fe8c398bca6e1f428e3181 Mon Sep 17 00:00:00 2001 From: eight Date: Tue, 5 Dec 2017 07:30:22 +0800 Subject: [PATCH] Fix: use min width/height for colorpicker --- msgbox/msgbox.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/msgbox/msgbox.js b/msgbox/msgbox.js index 35f55d77..406d21c2 100644 --- a/msgbox/msgbox.js +++ b/msgbox/msgbox.js @@ -21,8 +21,12 @@ function messageBox({ const {offsetWidth, offsetHeight} = messageBox.element.children[0]; messageBox.element.classList.remove('calculate-size'); - const width = Math.min(offsetWidth / 0.9 + 2, 800); - const height = Math.min(offsetHeight / 0.9 + 2, 600); + // for colorpicker + const MIN_WIDTH = 350; + const MIN_HEIGHT = 219; + + const width = Math.max(Math.min(offsetWidth / 0.9 + 2, 800), MIN_WIDTH); + const height = Math.max(Math.min(offsetHeight / 0.9 + 2, 600), MIN_HEIGHT); document.body.style.minWidth = `${width}px`; document.body.style.minHeight = `${height}px`;