Skip to content

Commit 6a3fa6c

Browse files
committed
fix undock to browser window with webcomponent
1 parent 756eba1 commit 6a3fa6c

7 files changed

+33
-7
lines changed

lib/css/dock-manager-context-menu.css

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.dockspab-tab-handle-context-menu {
2+
position: absolute;
3+
z-index: 10000000;
4+
background-color: white;
5+
border: white;
6+
border: black solid 2px;
7+
padding: 5px;
8+
}
9+
10+
.dockspab-tab-handle-context-menu>div {
11+
cursor: pointer;
12+
padding: 2px;
13+
}
14+
15+
.dockspab-tab-handle-context-menu>div:hover {
16+
background-color: gray;
17+
cursor: pointer;
18+
padding: 2px;
19+
}

lib/es5/dock-spawn-ts.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/PanelContainer.js

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/PanelContainer.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dock-spawn-ts",
3-
"version": "2.530.0",
3+
"version": "2.531.0",
44
"description": "DockSpawn Typescript Version",
55
"license": "MIT",
66
"author": "[email protected]",

page/demo/demo_webcomponent.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<script type="module">
77
import { DockSpawnTsWebcomponent } from "../../lib/js/webcomponent/DockSpawnTsWebcomponent.js";
88
</script>
9+
<link rel="stylesheet" href="../../lib/css/dock-manager-context-menu.css">
910
</head>
1011

1112
<body style="width: 100%; height: 100%; margin: 0;">
@@ -14,8 +15,8 @@
1415
</div>
1516

1617
<dock-spawn-ts id="dock_div" style="height:calc(100% - 40px); width: 100%; position: absolute; left: 0; top: 40px;">
17-
<div id="edt1" data-panel-caption="Steering.h" style="background: lightcoral; width: 100%; height: 100%; display: none;"></div>
18-
<div id="edt2" data-panel-caption="Steering.cpp" style="background: lightgoldenrodyellow; width: 100%; height: 100%; display: none;"></div>
18+
<div id="edt1" dock-spawn-panel-type="document" data-panel-caption="Steering.h" style="background: lightcoral; width: 100%; height: 100%; display: none;"></div>
19+
<div id="edt2" dock-spawn-panel-type="document" data-panel-caption="Steering.cpp" style="background: lightgoldenrodyellow; width: 100%; height: 100%; display: none;"></div>
1920
<div id="t1" dock-spawn-dock-type="left" dock-spawn-dock-ratio="0.25">abcd</div>
2021
<div id="t2" dock-spawn-dock-type="right" dock-spawn-dock-ratio="0.25">def</div>
2122
<div id="t3" dock-spawn-dock-type="down" dock-spawn-dock-ratio="0.5" dock-spawn-dock-to="t2">ghi</div>

src/PanelContainer.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,10 @@ export class PanelContainer implements IDockContainerWithSize {
457457
}
458458

459459
undockToBrowserDialog() {
460-
moveElementToNewBrowserWindow(this.elementContent, {
460+
let el: HTMLElement = this.elementContent;
461+
if (el instanceof HTMLSlotElement)
462+
el = <HTMLElement>el.assignedElements()[0]
463+
moveElementToNewBrowserWindow(el, {
461464
title: '',
462465
closeCallback: () => { },
463466
newWindowClosedCallback: () => { },

0 commit comments

Comments
 (0)