From 3fd0771c050e150554eabf5cfade19ec7d938cbc Mon Sep 17 00:00:00 2001 From: bordun Date: Mon, 7 Sep 2020 10:06:09 +0200 Subject: [PATCH] editor: % fix --- src/client/editor/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/editor/index.js b/src/client/editor/index.js index 72032fa3..4e7a2fa7 100644 --- a/src/client/editor/index.js +++ b/src/client/editor/index.js @@ -540,13 +540,13 @@ class Editor { let top = pastedData[i].top, left = pastedData[i].left - if (top.includes('%')) { + if (typeof top === 'string' && top.includes('%')) { top = parseFloat(top) / 100 * this.selectedWidgets[0].widget.offsetHeight pastedData[i]._atop = top pastedData[i]._ptop = true } - if (left.includes('%')) { + if (typeof left === 'string' && left.includes('%')) { left = parseFloat(left) / 100 * this.selectedWidgets[0].widget.offsetWidth pastedData[i]._aleft = left pastedData[i]._pleft = true