mirror of
https://github.com/Eugeny/tabby
synced 2024-11-14 17:07:15 +00:00
don't show drop hints when dragging the tab onto itself
This commit is contained in:
parent
90e56e7605
commit
85fe9eb4ec
2 changed files with 10 additions and 3 deletions
|
@ -147,6 +147,7 @@ export interface SplitDropZoneInfo {
|
|||
></split-tab-spanner>
|
||||
<split-tab-drop-zone
|
||||
*ngFor='let dropZone of _dropZones'
|
||||
[parent]='this'
|
||||
[dropZone]='dropZone'
|
||||
(tabDropped)='onTabDropped($event, dropZone)'
|
||||
>
|
||||
|
|
|
@ -22,6 +22,7 @@ import { SplitDropZoneInfo } from './splitTab.component'
|
|||
})
|
||||
export class SplitTabDropZoneComponent extends SelfPositioningComponent {
|
||||
@Input() dropZone: SplitDropZoneInfo
|
||||
@Input() parent: BaseTabComponent
|
||||
@Output() tabDropped = new EventEmitter<BaseTabComponent>()
|
||||
@HostBinding('class.active') isActive = false
|
||||
@HostBinding('class.highlighted') isHighlighted = false
|
||||
|
@ -32,8 +33,8 @@ export class SplitTabDropZoneComponent extends SelfPositioningComponent {
|
|||
app: AppService,
|
||||
) {
|
||||
super(element)
|
||||
this.subscribeUntilDestroyed(app.tabDragActive$, active => {
|
||||
this.isActive = active
|
||||
this.subscribeUntilDestroyed(app.tabDragActive$, tab => {
|
||||
this.isActive = !!tab && tab !== this.parent
|
||||
this.layout()
|
||||
})
|
||||
}
|
||||
|
@ -43,7 +44,12 @@ export class SplitTabDropZoneComponent extends SelfPositioningComponent {
|
|||
}
|
||||
|
||||
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 = {
|
||||
t: [0, 0, tabElement.clientWidth, tabElement.clientHeight / 5],
|
||||
|
|
Loading…
Reference in a new issue