dock-spawn-ts
Advanced tools
Comparing version 2.33.0 to 2.34.0
@@ -506,3 +506,2 @@ import { DockWheel } from "./DockWheel.js"; | ||
notifyOnActivePanelChange(panel) { | ||
console.log("active:", panel); | ||
this.layoutEventListeners.forEach((listener) => { | ||
@@ -509,0 +508,0 @@ if (listener.onActivePanelChange) { |
@@ -14,3 +14,2 @@ import { TabPage } from "./TabPage.js"; | ||
undockInitiator: UndockInitiator; | ||
mouseClickHandler: EventHandler; | ||
mouseDownHandler: EventHandler; | ||
@@ -20,3 +19,2 @@ closeButtonHandler: EventHandler; | ||
contextMenuHandler: EventHandler; | ||
moveThreshold: number; | ||
zIndexCounter: number; | ||
@@ -49,3 +47,2 @@ mouseMoveHandler: EventHandler; | ||
onMouseUp(e: any): void; | ||
generateMoveTabEvent(event: any, pos: any): void; | ||
moveTabEvent(that: any, state: any): void; | ||
@@ -57,3 +54,2 @@ onMouseMove(e: any): void; | ||
_performUndock(e: any, dragOffset: any): import("./Dialog.js").Dialog; | ||
onMouseClicked(e: any): void; | ||
onCloseButtonClicked(e: any): void; | ||
@@ -60,0 +56,0 @@ setSelected(isSelected: boolean): void; |
@@ -39,3 +39,2 @@ import { PanelContainer } from "./PanelContainer.js"; | ||
this.undockInitiator.enabled = true; | ||
this.mouseClickHandler = new EventHandler(this.elementBase, 'click', this.onMouseClicked.bind(this)); | ||
this.mouseDownHandler = new EventHandler(this.elementBase, 'mousedown', this.onMouseDown.bind(this)); | ||
@@ -45,3 +44,2 @@ this.closeButtonHandler = new EventHandler(this.elementCloseButton, 'mousedown', this.onCloseButtonClicked.bind(this)); | ||
this.contextMenuHandler = new EventHandler(this.elementBase, 'contextmenu', this.oncontextMenuClicked.bind(this)); | ||
this.moveThreshold = 3; | ||
this.zIndexCounter = 100; | ||
@@ -91,2 +89,3 @@ } | ||
onMouseDown(e) { | ||
this.parent.onSelected(); | ||
if (this.mouseMoveHandler) { | ||
@@ -109,4 +108,4 @@ this.mouseMoveHandler.cancel(); | ||
this.stargDragPosition = e.clientX; | ||
this.mouseMoveHandler = new EventHandler(this.elementBase, 'mousemove', this.onMouseMove.bind(this)); | ||
this.touchMoveHandler = new EventHandler(this.elementBase, 'touchmove', this.onMouseMove.bind(this)); | ||
this.mouseMoveHandler = new EventHandler(window, 'mousemove', this.onMouseMove.bind(this)); | ||
this.touchMoveHandler = new EventHandler(window, 'touchmove', this.onMouseMove.bind(this)); | ||
this.mouseUpHandler = new EventHandler(window, 'mouseup', this.onMouseUp.bind(this)); | ||
@@ -133,8 +132,2 @@ this.touchUpHandler = new EventHandler(window, 'touchend', this.onMouseUp.bind(this)); | ||
} | ||
generateMoveTabEvent(event, pos) { | ||
let contain = pos > event.rect.left && pos < event.rect.right; | ||
let m = Math.abs(event.bound - pos); | ||
if (m < this.moveThreshold && contain) | ||
this.moveTabEvent(this, event.state); | ||
} | ||
moveTabEvent(that, state) { | ||
@@ -160,4 +153,4 @@ that.eventListeners.forEach((listener) => { | ||
: { state: 'right', bound: tabRect.right, rect: tabRect }; | ||
if (this.direction !== 0) | ||
this.generateMoveTabEvent(event, this.current); | ||
if ((e.clientX < tabRect.left && this.direction < 0) || (e.clientX > tabRect.left + tabRect.width && this.direction > 0)) | ||
this.moveTabEvent(this, event.state); | ||
} | ||
@@ -178,3 +171,2 @@ } | ||
panel.removeListener(this.undockListener); | ||
this.mouseClickHandler.cancel(); | ||
this.mouseDownHandler.cancel(); | ||
@@ -206,5 +198,2 @@ this.closeButtonHandler.cancel(); | ||
} | ||
onMouseClicked(e) { | ||
this.parent.onSelected(); | ||
} | ||
onCloseButtonClicked(e) { | ||
@@ -216,5 +205,2 @@ if (e.button !== 2) { | ||
panel.close(); | ||
// this.undockInitiator.enabled = false; | ||
// let panel = this.parent.container; | ||
// panel.performUndock(); | ||
} | ||
@@ -221,0 +207,0 @@ } |
@@ -12,3 +12,3 @@ import { EventHandler } from "./EventHandler.js"; | ||
if (!thresholdPixels) { | ||
thresholdPixels = 5; | ||
thresholdPixels = 7; | ||
} | ||
@@ -15,0 +15,0 @@ this.element = element; |
{ | ||
"name": "dock-spawn-ts", | ||
"version": "2.33.0", | ||
"version": "2.34.0", | ||
"description": "DockSpawn Typescript Version", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -610,4 +610,2 @@ import { DockWheel } from "./DockWheel.js"; | ||
notifyOnActivePanelChange(panel: PanelContainer) { | ||
console.log("active:", panel); | ||
this.layoutEventListeners.forEach((listener) => { | ||
@@ -614,0 +612,0 @@ if (listener.onActivePanelChange) { |
@@ -18,3 +18,2 @@ import { TabPage } from "./TabPage.js"; | ||
undockInitiator: UndockInitiator; | ||
mouseClickHandler: EventHandler; | ||
mouseDownHandler: EventHandler; | ||
@@ -24,3 +23,2 @@ closeButtonHandler: EventHandler; | ||
contextMenuHandler: EventHandler; | ||
moveThreshold: number; | ||
zIndexCounter: number; | ||
@@ -75,3 +73,2 @@ mouseMoveHandler: EventHandler; | ||
this.undockInitiator.enabled = true; | ||
this.mouseClickHandler = new EventHandler(this.elementBase, 'click', this.onMouseClicked.bind(this)); | ||
this.mouseDownHandler = new EventHandler(this.elementBase, 'mousedown', this.onMouseDown.bind(this)); | ||
@@ -82,3 +79,2 @@ this.closeButtonHandler = new EventHandler(this.elementCloseButton, 'mousedown', this.onCloseButtonClicked.bind(this)); | ||
this.moveThreshold = 3; | ||
this.zIndexCounter = 100; | ||
@@ -148,3 +144,3 @@ } | ||
closeContextMenu() { | ||
closeContextMenu() { | ||
if (this._ctxMenu) { | ||
@@ -168,2 +164,4 @@ document.body.removeChild(this._ctxMenu); | ||
onMouseDown(e) { | ||
this.parent.onSelected(); | ||
if (this.mouseMoveHandler) { | ||
@@ -186,4 +184,4 @@ this.mouseMoveHandler.cancel(); | ||
this.stargDragPosition = e.clientX; | ||
this.mouseMoveHandler = new EventHandler(this.elementBase, 'mousemove', this.onMouseMove.bind(this)); | ||
this.touchMoveHandler = new EventHandler(this.elementBase, 'touchmove', this.onMouseMove.bind(this)); | ||
this.mouseMoveHandler = new EventHandler(window, 'mousemove', this.onMouseMove.bind(this)); | ||
this.touchMoveHandler = new EventHandler(window, 'touchmove', this.onMouseMove.bind(this)); | ||
this.mouseUpHandler = new EventHandler(window, 'mouseup', this.onMouseUp.bind(this)); | ||
@@ -212,9 +210,2 @@ this.touchUpHandler = new EventHandler(window, 'touchend', this.onMouseUp.bind(this)); | ||
generateMoveTabEvent(event, pos) { | ||
let contain = pos > event.rect.left && pos < event.rect.right; | ||
let m = Math.abs(event.bound - pos); | ||
if (m < this.moveThreshold && contain) | ||
this.moveTabEvent(this, event.state); | ||
} | ||
moveTabEvent(that, state) { | ||
@@ -241,3 +232,4 @@ that.eventListeners.forEach((listener) => { | ||
: { state: 'right', bound: tabRect.right, rect: tabRect }; | ||
if (this.direction !== 0) this.generateMoveTabEvent(event, this.current); | ||
if ((e.clientX < tabRect.left && this.direction < 0) || (e.clientX > tabRect.left + tabRect.width && this.direction > 0)) | ||
this.moveTabEvent(this, event.state); | ||
} | ||
@@ -262,3 +254,2 @@ } | ||
this.mouseClickHandler.cancel(); | ||
this.mouseDownHandler.cancel(); | ||
@@ -294,6 +285,2 @@ this.closeButtonHandler.cancel(); | ||
onMouseClicked(e) { | ||
this.parent.onSelected(); | ||
} | ||
onCloseButtonClicked(e) { | ||
@@ -305,5 +292,2 @@ if (e.button !== 2) { | ||
panel.close(); | ||
// this.undockInitiator.enabled = false; | ||
// let panel = this.parent.container; | ||
// panel.performUndock(); | ||
} | ||
@@ -310,0 +294,0 @@ } |
@@ -28,3 +28,3 @@ import { EventHandler } from "./EventHandler.js"; | ||
if (!thresholdPixels) { | ||
thresholdPixels = 5; | ||
thresholdPixels = 7; | ||
} | ||
@@ -31,0 +31,0 @@ |
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
667888
9519