dock-spawn-ts
Advanced tools
Comparing version 2.402.0 to 2.403.0
@@ -156,2 +156,12 @@ import { DockWheel } from "./DockWheel.js"; | ||
this.context.model.rootNode.container.resize(width, height); | ||
let offsetX = 0, offsetY = 0; | ||
for (let dialog of this.context.model.dialogs) { | ||
if (dialog.position.x > this.element.clientWidth || dialog.position.y > this.element.clientHeight) { | ||
if (offsetX > this.element.clientWidth || offsetY > this.element.clientHeight) | ||
offsetX = 0, offsetY = 0; | ||
dialog.setPosition(100 + offsetX, 100 + offsetY); | ||
offsetX += 100; | ||
offsetY += 100; | ||
} | ||
} | ||
} | ||
@@ -158,0 +168,0 @@ /** |
@@ -14,4 +14,4 @@ import { EventHandler } from "./EventHandler.js"; | ||
this.touchDownHandler = new EventHandler(dragHandle, 'touchstart', this.onMouseDown.bind(this)); | ||
this.topLevelElement.style.marginLeft = topLevelElement.offsetLeft + 'px'; | ||
this.topLevelElement.style.marginTop = topLevelElement.offsetTop + 'px'; | ||
this.topLevelElement.style.left = topLevelElement.offsetLeft + 'px'; | ||
this.topLevelElement.style.top = topLevelElement.offsetTop + 'px'; | ||
this.minimumAllowedChildNodes = delegate.minimumAllowedChildNodes; | ||
@@ -176,8 +176,8 @@ this.iframeEventHandlers = []; | ||
_performDrag(dx, dy) { | ||
let left = dx + Utils.getPixels(this.topLevelElement.style.marginLeft); | ||
let top = dy + Utils.getPixels(this.topLevelElement.style.marginTop); | ||
this.topLevelElement.style.marginLeft = left + 'px'; | ||
this.topLevelElement.style.marginTop = top + 'px'; | ||
let left = dx + Utils.getPixels(this.topLevelElement.style.left); | ||
let top = dy + Utils.getPixels(this.topLevelElement.style.top); | ||
this.topLevelElement.style.left = left + 'px'; | ||
this.topLevelElement.style.top = top + 'px'; | ||
} | ||
} | ||
//# sourceMappingURL=DraggableContainer.js.map |
@@ -17,4 +17,4 @@ import { ResizeHandle } from "./ResizeHandle.js"; | ||
this.containerType = delegate.containerType; | ||
this.topLevelElement.style.marginLeft = this.topLevelElement.offsetLeft + 'px'; | ||
this.topLevelElement.style.marginTop = this.topLevelElement.offsetTop + 'px'; | ||
this.topLevelElement.style.left = this.topLevelElement.offsetLeft + 'px'; | ||
this.topLevelElement.style.top = this.topLevelElement.offsetTop + 'px'; | ||
this.minimumAllowedChildNodes = delegate.minimumAllowedChildNodes; | ||
@@ -201,4 +201,4 @@ this._buildResizeHandles(); | ||
let bounds = {}; | ||
bounds.left = Utils.getPixels(this.topLevelElement.style.marginLeft); | ||
bounds.top = Utils.getPixels(this.topLevelElement.style.marginTop); | ||
bounds.left = Utils.getPixels(this.topLevelElement.style.left); | ||
bounds.top = Utils.getPixels(this.topLevelElement.style.top); | ||
bounds.width = this.topLevelElement.clientWidth; | ||
@@ -236,4 +236,4 @@ bounds.height = this.topLevelElement.clientHeight; | ||
bounds.height = Math.max(bounds.height, minHeight); | ||
this.topLevelElement.style.marginLeft = bounds.left + 'px'; | ||
this.topLevelElement.style.marginTop = bounds.top + 'px'; | ||
this.topLevelElement.style.left = bounds.left + 'px'; | ||
this.topLevelElement.style.top = bounds.top + 'px'; | ||
this.resize(bounds.width, bounds.height); | ||
@@ -240,0 +240,0 @@ } |
{ | ||
"name": "dock-spawn-ts", | ||
"version": "2.402.0", | ||
"version": "2.403.0", | ||
"description": "DockSpawn Typescript Version", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -204,2 +204,13 @@ import { DockWheel } from "./DockWheel.js"; | ||
this.context.model.rootNode.container.resize(width, height); | ||
let offsetX = 0, offsetY = 0; | ||
for (let dialog of this.context.model.dialogs){ | ||
if(dialog.position.x > this.element.clientWidth || dialog.position.y > this.element.clientHeight){ | ||
if(offsetX > this.element.clientWidth || offsetY > this.element.clientHeight) | ||
offsetX = 0, offsetY = 0; | ||
dialog.setPosition(100 + offsetX, 100 + offsetY); | ||
offsetX += 100; | ||
offsetY += 100; | ||
} | ||
} | ||
} | ||
@@ -206,0 +217,0 @@ |
@@ -38,4 +38,4 @@ import { Dialog } from "./Dialog.js"; | ||
this.touchDownHandler = new EventHandler(dragHandle, 'touchstart', this.onMouseDown.bind(this)); | ||
this.topLevelElement.style.marginLeft = topLevelElement.offsetLeft + 'px'; | ||
this.topLevelElement.style.marginTop = topLevelElement.offsetTop + 'px'; | ||
this.topLevelElement.style.left = topLevelElement.offsetLeft + 'px'; | ||
this.topLevelElement.style.top = topLevelElement.offsetTop + 'px'; | ||
this.minimumAllowedChildNodes = delegate.minimumAllowedChildNodes; | ||
@@ -223,7 +223,7 @@ this.iframeEventHandlers = []; | ||
_performDrag(dx: number, dy: number) { | ||
let left = dx + Utils.getPixels(this.topLevelElement.style.marginLeft); | ||
let top = dy + Utils.getPixels(this.topLevelElement.style.marginTop); | ||
this.topLevelElement.style.marginLeft = left + 'px'; | ||
this.topLevelElement.style.marginTop = top + 'px'; | ||
let left = dx + Utils.getPixels(this.topLevelElement.style.left); | ||
let top = dy + Utils.getPixels(this.topLevelElement.style.top); | ||
this.topLevelElement.style.left = left + 'px'; | ||
this.topLevelElement.style.top = top + 'px'; | ||
} | ||
} |
@@ -38,4 +38,4 @@ import { Dialog } from "./Dialog.js"; | ||
this.containerType = delegate.containerType; | ||
this.topLevelElement.style.marginLeft = this.topLevelElement.offsetLeft + 'px'; | ||
this.topLevelElement.style.marginTop = this.topLevelElement.offsetTop + 'px'; | ||
this.topLevelElement.style.left = this.topLevelElement.offsetLeft + 'px'; | ||
this.topLevelElement.style.top = this.topLevelElement.offsetTop + 'px'; | ||
this.minimumAllowedChildNodes = delegate.minimumAllowedChildNodes; | ||
@@ -247,4 +247,4 @@ this._buildResizeHandles(); | ||
let bounds: IThickness = {}; | ||
bounds.left = Utils.getPixels(this.topLevelElement.style.marginLeft); | ||
bounds.top = Utils.getPixels(this.topLevelElement.style.marginTop); | ||
bounds.left = Utils.getPixels(this.topLevelElement.style.left); | ||
bounds.top = Utils.getPixels(this.topLevelElement.style.top); | ||
bounds.width = this.topLevelElement.clientWidth; | ||
@@ -286,4 +286,4 @@ bounds.height = this.topLevelElement.clientHeight; | ||
this.topLevelElement.style.marginLeft = bounds.left + 'px'; | ||
this.topLevelElement.style.marginTop = bounds.top + 'px'; | ||
this.topLevelElement.style.left = bounds.left + 'px'; | ||
this.topLevelElement.style.top = bounds.top + 'px'; | ||
@@ -290,0 +290,0 @@ this.resize(bounds.width, bounds.height); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
730114
10267