Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
1 -popin: add number verification on dimensions (l3mpire#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowtter authored and xsyann committed Nov 24, 2022
1 parent 2fa1db1 commit 758e97d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/client/character-pop-ins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 758e97d

Please sign in to comment.