Moving away from Azure Devops #1
1 changed files with 15 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { IEventBus } from '../../types/CalendarTypes';
|
import { IEventBus } from '../../types/CalendarTypes';
|
||||||
import { IGridConfig } from '../../core/IGridConfig';
|
import { IGridConfig } from '../../core/IGridConfig';
|
||||||
import { CoreEvents } from '../../constants/CoreEvents';
|
import { CoreEvents } from '../../constants/CoreEvents';
|
||||||
|
import { HeaderDrawerManager } from '../../core/HeaderDrawerManager';
|
||||||
import {
|
import {
|
||||||
IDragEnterHeaderPayload,
|
IDragEnterHeaderPayload,
|
||||||
IDragMoveHeaderPayload,
|
IDragMoveHeaderPayload,
|
||||||
|
|
@ -20,10 +21,12 @@ export class HeaderDrawerRenderer {
|
||||||
private currentItem: HTMLElement | null = null;
|
private currentItem: HTMLElement | null = null;
|
||||||
private container: HTMLElement | null = null;
|
private container: HTMLElement | null = null;
|
||||||
private sourceElement: HTMLElement | null = null;
|
private sourceElement: HTMLElement | null = null;
|
||||||
|
private wasExpandedBeforeDrag = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private eventBus: IEventBus,
|
private eventBus: IEventBus,
|
||||||
private gridConfig: IGridConfig
|
private gridConfig: IGridConfig,
|
||||||
|
private headerDrawerManager: HeaderDrawerManager
|
||||||
) {
|
) {
|
||||||
this.setupListeners();
|
this.setupListeners();
|
||||||
}
|
}
|
||||||
|
|
@ -63,6 +66,12 @@ export class HeaderDrawerRenderer {
|
||||||
this.container = document.querySelector('swp-header-drawer');
|
this.container = document.querySelector('swp-header-drawer');
|
||||||
if (!this.container) return;
|
if (!this.container) return;
|
||||||
|
|
||||||
|
// Remember if drawer was already expanded
|
||||||
|
this.wasExpandedBeforeDrag = this.headerDrawerManager.isExpanded();
|
||||||
|
|
||||||
|
// Expand drawer with animation
|
||||||
|
this.headerDrawerManager.expand();
|
||||||
|
|
||||||
// Store reference to source element
|
// Store reference to source element
|
||||||
this.sourceElement = payload.element;
|
this.sourceElement = payload.element;
|
||||||
|
|
||||||
|
|
@ -147,5 +156,10 @@ export class HeaderDrawerRenderer {
|
||||||
this.sourceElement.style.visibility = '';
|
this.sourceElement.style.visibility = '';
|
||||||
this.sourceElement = null;
|
this.sourceElement = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Collapse drawer if it wasn't expanded before drag
|
||||||
|
if (!this.wasExpandedBeforeDrag) {
|
||||||
|
this.headerDrawerManager.collapse();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue