Skip to content

Commit 640ece0

Browse files
committed
fix: 修复浮动窗口无法缩放及浮动窗口恢复后不显示激活的panel
1 parent 76a03e1 commit 640ece0

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

src/components/BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,6 @@
290290
.bb-dockview .bb-overflowHidden {
291291
overflow: hidden;
292292
}
293+
.bb-dockview .dv-render-overlay-float {
294+
z-index: -1!important;
295+
}

src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,6 @@ const createGroupActions = (group, groupType) => {
167167
if (item.name !== 'bar') {
168168
const icon = getIcon(item.name);
169169
actionContainer.append(icon);
170-
if(icon.classList.contains('bb-dockview-control-icon-dropdown')){
171-
setTimeout(() => {
172-
if (group.model.location.type == 'floating' && group.panels.some(panel => panel.renderer == 'always')) {
173-
observeDisplayChange(icon, group)
174-
}
175-
}, 0)
176-
}
177170
}
178171
});
179172
setTimeout(() => {
@@ -642,11 +635,12 @@ const dock = (group, floatType) => {
642635
else {
643636
group.setParams({ rect })
644637
}
638+
const activePanel = group.activePanel
645639
dockview.moveGroup({
646640
from: { group: group },
647641
to: { group: originGroup, position: 'center' }
648642
})
649-
643+
dockview.setActivePanel(activePanel)
650644
saveConfig(dockview)
651645
}
652646

src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ const observePanelActiveChange = panel => {
1919
if (isActive && panel.group.getParams().floatType == 'drawer') {
2020
setDrawerTitle(panel.group)
2121
}
22+
setTimeout(function () {
23+
if (panel.group.model.location.type === 'floating' && panel.renderer == 'always') {
24+
if (isActive) {
25+
const contentContainerEle = panel.group.element.querySelector('.dv-content-container');
26+
const contentEle = panel.view.content.element;
27+
contentEle.parentEle = contentEle.parentElement
28+
contentContainerEle.appendChild(contentEle);
29+
}
30+
else if (isActive === false && panel !== panel.group.activePanel) {
31+
panel.view.content.element.parentEle?.appendChild(panel.view.content.element);
32+
panel.view.content.element.parentEle && delete panel.view.content.element.parentEle;
33+
}
34+
}
35+
}, 0)
2236
})
2337
}
2438

0 commit comments

Comments
 (0)