dock-spawn-ts
Advanced tools
Comparing version 2.514.0 to 2.515.0
@@ -69,4 +69,5 @@ import { DockWheel } from "./DockWheel.js"; | ||
return this.checkXBoundsWithinDockContainer(container, currentMousePosition, previousMousePosition, resizeWest, resizeEast); | ||
let rect = this.element.getBoundingClientRect(); | ||
let dx = Math.floor(currentMousePosition.x - previousMousePosition.x); | ||
let leftBounds = container.offsetLeft + container.offsetWidth + dx < 40; // || (container.offsetLeft + container.offsetWidth + dx - 40 ) < 0; | ||
let leftBounds = container.offsetLeft + container.offsetWidth + dx + rect.left < 40; // || (container.offsetLeft + container.offsetWidth + dx - 40 ) < 0; | ||
let rightBounds = container.offsetLeft + dx > (window.innerWidth - 40); | ||
@@ -110,4 +111,5 @@ if (leftBounds) { | ||
return this.checkYBoundsWithinDockContainer(container, currentMousePosition, previousMousePosition, resizeNorth, resizeSouth); | ||
let rect = this.element.getBoundingClientRect(); | ||
let dy = Math.floor(currentMousePosition.y - previousMousePosition.y); | ||
let topBounds = container.offsetTop + dy < 0; | ||
let topBounds = container.offsetTop + dy + rect.top < 0; | ||
let bottomBounds = container.offsetTop + dy > (window.innerHeight - 16); | ||
@@ -432,3 +434,3 @@ if (topBounds) { | ||
let dialog = new Dialog(container, this, null, disableResize); | ||
if (event !== undefined) { | ||
if (event != null) { | ||
// Adjust the relative position | ||
@@ -435,0 +437,0 @@ let dialogWidth = dialog.elementDialog.clientWidth; |
@@ -30,2 +30,3 @@ import { DockManager } from "../DockManager.js"; | ||
dockDown(element: HTMLElement, panelType?: PanelType, dockNode?: DockNode, ratio?: number, title?: string): void; | ||
floatDialog(element: HTMLElement, x: number, y: number, width: number, height: number, panelType?: PanelType, title?: string): void; | ||
} |
@@ -150,2 +150,7 @@ import { DockManager } from "../DockManager.js"; | ||
} | ||
floatDialog(element, x, y, width, height, panelType, title) { | ||
let container = new PanelContainer(element, this.dockManager, title, panelType); | ||
let dlg = this.dockManager.floatDialog(container, x, y, null); | ||
dlg.resize(width, height); | ||
} | ||
} | ||
@@ -152,0 +157,0 @@ DockSpawnTsWebcomponent.cssRootDirectory = "../../lib/css/"; |
{ | ||
"name": "dock-spawn-ts", | ||
"version": "2.514.0", | ||
"version": "2.515.0", | ||
"description": "DockSpawn Typescript Version", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -113,4 +113,5 @@ import { DockWheel } from "./DockWheel.js"; | ||
let rect = this.element.getBoundingClientRect(); | ||
let dx = Math.floor(currentMousePosition.x - previousMousePosition.x); | ||
let leftBounds = container.offsetLeft + container.offsetWidth + dx < 40; // || (container.offsetLeft + container.offsetWidth + dx - 40 ) < 0; | ||
let leftBounds = container.offsetLeft + container.offsetWidth + dx + rect.left < 40; // || (container.offsetLeft + container.offsetWidth + dx - 40 ) < 0; | ||
let rightBounds = container.offsetLeft + dx > (window.innerWidth - 40); | ||
@@ -157,4 +158,5 @@ if (leftBounds) { | ||
let rect = this.element.getBoundingClientRect(); | ||
let dy = Math.floor(currentMousePosition.y - previousMousePosition.y); | ||
let topBounds = container.offsetTop + dy < 0; | ||
let topBounds = container.offsetTop + dy + rect.top < 0; | ||
let bottomBounds = container.offsetTop + dy > (window.innerHeight - 16); | ||
@@ -526,3 +528,3 @@ if (topBounds) { | ||
if (event !== undefined) { | ||
if (event != null) { | ||
// Adjust the relative position | ||
@@ -529,0 +531,0 @@ let dialogWidth = dialog.elementDialog.clientWidth; |
@@ -188,4 +188,10 @@ import { DockManager } from "../DockManager.js"; | ||
} | ||
floatDialog(element: HTMLElement, x: number, y: number, width: number, height: number, panelType?: PanelType, title?: string) { | ||
let container = new PanelContainer(element as HTMLElement, this.dockManager, title, panelType); | ||
let dlg = this.dockManager.floatDialog(container, x, y, null); | ||
dlg.resize(width, height); | ||
} | ||
} | ||
window.customElements.define('dock-spawn-ts', DockSpawnTsWebcomponent); |
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
757907
10523