From 758e97dcd9e3060f13432ba5ec6e9185b66f2ed8 Mon Sep 17 00:00:00 2001 From: Brice Parent <34689945+Flowtter@users.noreply.github.com> Date: Thu, 24 Nov 2022 13:54:45 +0100 Subject: [PATCH] 1 -popin: add number verification on dimensions (#219) --- core/client/character-pop-ins.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/client/character-pop-ins.js b/core/client/character-pop-ins.js index 668c42fa8..6482b6fc0 100644 --- a/core/client/character-pop-ins.js +++ b/core/client/character-pop-ins.js @@ -63,8 +63,14 @@ characterPopIns = { else if (content !== popIn.node.innerHTML) popIn.setHTML(content); const { style } = popIn.node; - if (config.width) style.width = `${config.width}px`; - if (config.height) style.height = `${config.height}px`; + if (config.width) { + if (typeof config.width === 'number') style.width = `${config.width}px`; + else style.width = config.width; + } + if (config.height) { + if (typeof config.height === 'number') style.height = `${config.height}px`; + else style.height = config.height; + } const className = config.className ? [this.className, config.className].join(' ') : this.className; popIn.setClassName(className);