mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-10 22:50:04 +00:00
don't show drop hints when dragging the tab onto itself
This commit is contained in:
parent
90e56e7605
commit
85fe9eb4ec
@ -147,6 +147,7 @@ export interface SplitDropZoneInfo {
|
|||||||
></split-tab-spanner>
|
></split-tab-spanner>
|
||||||
<split-tab-drop-zone
|
<split-tab-drop-zone
|
||||||
*ngFor='let dropZone of _dropZones'
|
*ngFor='let dropZone of _dropZones'
|
||||||
|
[parent]='this'
|
||||||
[dropZone]='dropZone'
|
[dropZone]='dropZone'
|
||||||
(tabDropped)='onTabDropped($event, dropZone)'
|
(tabDropped)='onTabDropped($event, dropZone)'
|
||||||
>
|
>
|
||||||
|
@ -22,6 +22,7 @@ import { SplitDropZoneInfo } from './splitTab.component'
|
|||||||
})
|
})
|
||||||
export class SplitTabDropZoneComponent extends SelfPositioningComponent {
|
export class SplitTabDropZoneComponent extends SelfPositioningComponent {
|
||||||
@Input() dropZone: SplitDropZoneInfo
|
@Input() dropZone: SplitDropZoneInfo
|
||||||
|
@Input() parent: BaseTabComponent
|
||||||
@Output() tabDropped = new EventEmitter<BaseTabComponent>()
|
@Output() tabDropped = new EventEmitter<BaseTabComponent>()
|
||||||
@HostBinding('class.active') isActive = false
|
@HostBinding('class.active') isActive = false
|
||||||
@HostBinding('class.highlighted') isHighlighted = false
|
@HostBinding('class.highlighted') isHighlighted = false
|
||||||
@ -32,8 +33,8 @@ export class SplitTabDropZoneComponent extends SelfPositioningComponent {
|
|||||||
app: AppService,
|
app: AppService,
|
||||||
) {
|
) {
|
||||||
super(element)
|
super(element)
|
||||||
this.subscribeUntilDestroyed(app.tabDragActive$, active => {
|
this.subscribeUntilDestroyed(app.tabDragActive$, tab => {
|
||||||
this.isActive = active
|
this.isActive = !!tab && tab !== this.parent
|
||||||
this.layout()
|
this.layout()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -43,7 +44,12 @@ export class SplitTabDropZoneComponent extends SelfPositioningComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
layout () {
|
layout () {
|
||||||
const tabElement: HTMLElement = this.dropZone.relativeToTab.viewContainerEmbeddedRef?.rootNodes[0]
|
const tabElement: HTMLElement|undefined = this.dropZone.relativeToTab.viewContainerEmbeddedRef?.rootNodes[0]
|
||||||
|
|
||||||
|
if (!tabElement) {
|
||||||
|
// being destroyed
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const args = {
|
const args = {
|
||||||
t: [0, 0, tabElement.clientWidth, tabElement.clientHeight / 5],
|
t: [0, 0, tabElement.clientWidth, tabElement.clientHeight / 5],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user