|
@@ -89,8 +89,10 @@ const checkElementisCovered = (id, type) => {
|
|
|
|
|
|
if (type === "PANE_BOX") {
|
|
|
const limitHeight = elementDom.offsetHeight;
|
|
|
+ const limitWidth = elementDom.offsetWidth;
|
|
|
|
|
|
- let elementHeights = [];
|
|
|
+ let elementHeights = [],
|
|
|
+ elementWidths = [];
|
|
|
const elementChildren = elementDom.querySelector(
|
|
|
".elem-pane-box-elements"
|
|
|
).childNodes;
|
|
@@ -103,8 +105,16 @@ const checkElementisCovered = (id, type) => {
|
|
|
elementHeights.push(
|
|
|
node.firstChild.offsetHeight + node.firstChild.offsetTop
|
|
|
);
|
|
|
+ elementWidths.push(
|
|
|
+ node.firstChild.offsetWidth + node.firstChild.offsetLeft
|
|
|
+ );
|
|
|
});
|
|
|
- return elementHeights.some((item) => item > limitHeight);
|
|
|
+
|
|
|
+ console.log(elementWidths, limitWidth);
|
|
|
+ return (
|
|
|
+ elementHeights.some((item) => item > limitHeight) ||
|
|
|
+ elementWidths.some((item) => item > limitWidth)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
return elementDom.offsetHeight < elementDom.firstChild.offsetHeight;
|
|
@@ -237,6 +247,11 @@ const actions = {
|
|
|
}
|
|
|
if (isResetId) {
|
|
|
element.id = getElementId();
|
|
|
+ if (element.elements && element.elements.length) {
|
|
|
+ element.elements.forEach((child) => {
|
|
|
+ child.container.id = element.id;
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|