dock-spawn-ts
Advanced tools
Comparing version 2.290.0 to 2.300.0
@@ -17,3 +17,3 @@ import { DockManager } from "./DockManager.js"; | ||
export declare class PanelContainer implements IDockContainerWithSize { | ||
onTitleChanged: any; | ||
onTitleChanged: (panelContainer: PanelContainer, title: string) => void; | ||
elementPanel: HTMLDivElement; | ||
@@ -34,2 +34,3 @@ elementTitle: HTMLDivElement; | ||
icon: string; | ||
hasChanges: boolean; | ||
minimumAllowedChildNodes: number; | ||
@@ -90,2 +91,3 @@ isDialog: boolean; | ||
setTitleIcon(icon: string): void; | ||
setHasChanges(changes: boolean): void; | ||
setCloseIconTemplate(closeIconTemplate: string): void; | ||
@@ -92,0 +94,0 @@ _updateTitle(): void; |
@@ -278,2 +278,14 @@ import { Utils } from "./Utils.js"; | ||
} | ||
setHasChanges(changes) { | ||
this.hasChanges = changes; | ||
this._updateTitle(); | ||
if (changes) { | ||
this.elementTitleText.classList.add('panel-has-changes'); | ||
} | ||
else { | ||
this.elementTitleText.classList.remove('panel-has-changes'); | ||
} | ||
if (this.onTitleChanged) | ||
this.onTitleChanged(this, this.title); | ||
} | ||
setCloseIconTemplate(closeIconTemplate) { | ||
@@ -280,0 +292,0 @@ this.elementButtonClose.innerHTML = closeIconTemplate; |
@@ -17,7 +17,16 @@ import { TabHandle } from "./TabHandle.js"; | ||
this.panel.onTitleChanged = this.onTitleChanged.bind(this); | ||
this.onTitleChanged(); | ||
} | ||
container.tabPage = this; | ||
} | ||
onTitleChanged( /*sender, title*/) { | ||
onTitleChanged() { | ||
this.handle.updateTitle(); | ||
if (this.panel) { | ||
if (this.panel.hasChanges) { | ||
this.handle.elementText.classList.add('panel-has-changes'); | ||
} | ||
else { | ||
this.handle.elementText.classList.remove('panel-has-changes'); | ||
} | ||
} | ||
} | ||
@@ -24,0 +33,0 @@ destroy() { |
{ | ||
"name": "dock-spawn-ts", | ||
"version": "2.290.0", | ||
"version": "2.300.0", | ||
"description": "DockSpawn Typescript Version", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -20,3 +20,3 @@ import { DockManager } from "./DockManager.js"; | ||
onTitleChanged: any; | ||
onTitleChanged: (panelContainer: PanelContainer, title: string) => void; | ||
elementPanel: HTMLDivElement; | ||
@@ -34,2 +34,3 @@ elementTitle: HTMLDivElement; | ||
icon: string; | ||
hasChanges: boolean; | ||
minimumAllowedChildNodes: number; | ||
@@ -357,2 +358,14 @@ isDialog: boolean; | ||
setHasChanges(changes: boolean) { | ||
this.hasChanges = changes; | ||
this._updateTitle(); | ||
if (changes) { | ||
this.elementTitleText.classList.add('panel-has-changes') | ||
} else { | ||
this.elementTitleText.classList.remove('panel-has-changes') | ||
} | ||
if (this.onTitleChanged) | ||
this.onTitleChanged(this, this.title); | ||
} | ||
setCloseIconTemplate(closeIconTemplate: string) { | ||
@@ -359,0 +372,0 @@ this.elementButtonClose.innerHTML = closeIconTemplate; |
@@ -31,2 +31,3 @@ import { TabHandle } from "./TabHandle.js"; | ||
this.panel.onTitleChanged = this.onTitleChanged.bind(this); | ||
this.onTitleChanged(); | ||
} | ||
@@ -37,4 +38,11 @@ | ||
onTitleChanged(/*sender, title*/) { | ||
onTitleChanged() { | ||
this.handle.updateTitle(); | ||
if (this.panel) { | ||
if (this.panel.hasChanges) { | ||
this.handle.elementText.classList.add('panel-has-changes') | ||
} else { | ||
this.handle.elementText.classList.remove('panel-has-changes') | ||
} | ||
} | ||
} | ||
@@ -41,0 +49,0 @@ |
Sorry, the diff of this file is not supported yet
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
724082
202
10205