mirror of
https://github.com/mathuo/dockview
synced 2025-03-11 16:32:06 +00:00
handle edge drops for onWillShowOverlay
This commit is contained in:
parent
60f49ce449
commit
5a635336b3
@ -568,6 +568,19 @@ export class DockviewComponent
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.addDisposables(
|
this.addDisposables(
|
||||||
|
this._rootDropTarget,
|
||||||
|
this._rootDropTarget.onWillShowOverlay((event) => {
|
||||||
|
if (this.gridview.length > 0 && event.position === 'center') {
|
||||||
|
// option only available when no panels in primary grid
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._onWillShowOverlay.fire(
|
||||||
|
new WillShowOverlayLocationEvent(event, {
|
||||||
|
kind: 'edge',
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}),
|
||||||
this._rootDropTarget.onDrop((event) => {
|
this._rootDropTarget.onDrop((event) => {
|
||||||
const willDropEvent = new DockviewWillDropEvent({
|
const willDropEvent = new DockviewWillDropEvent({
|
||||||
nativeEvent: event.nativeEvent,
|
nativeEvent: event.nativeEvent,
|
||||||
@ -576,7 +589,7 @@ export class DockviewComponent
|
|||||||
api: this._api,
|
api: this._api,
|
||||||
group: undefined,
|
group: undefined,
|
||||||
getData: getPanelData,
|
getData: getPanelData,
|
||||||
kind: 'content',
|
kind: 'edge',
|
||||||
});
|
});
|
||||||
|
|
||||||
this._onWillDrop.fire(willDropEvent);
|
this._onWillDrop.fire(willDropEvent);
|
||||||
|
@ -125,7 +125,11 @@ export interface IHeader {
|
|||||||
|
|
||||||
export type DockviewGroupPanelLocked = boolean | 'no-drop-target';
|
export type DockviewGroupPanelLocked = boolean | 'no-drop-target';
|
||||||
|
|
||||||
export type DockviewGroupDropLocation = 'tab' | 'header_space' | 'content';
|
export type DockviewGroupDropLocation =
|
||||||
|
| 'tab'
|
||||||
|
| 'header_space'
|
||||||
|
| 'content'
|
||||||
|
| 'edge';
|
||||||
|
|
||||||
export interface IDockviewGroupPanelModel extends IPanel {
|
export interface IDockviewGroupPanelModel extends IPanel {
|
||||||
readonly isActive: boolean;
|
readonly isActive: boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user