Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.subscribe((resize: number) => {
// show drag arrows on drag release but only if the stream is not a drag handle
// 0 is initial drag and -1 is mouse release
if (this._chart._range && resize < 1) {
this._chart._range._reflectRangeReleased(isMouseRelease(resize));
// if the drag is completed we can emit a stateChanges
if (isMouseRelease(resize)) {
this._chart._range._emitDragEnd();
this._chart._range.focus();
}
}
// every drag regardless of if it is a handle or initial drag should have the grab cursors
if (resize >= 0) {
addCssClass(this._elementRef.nativeElement, GRAB_CURSOR_CLASS);
} else {
removeCssClass(this._elementRef.nativeElement, GRAB_CURSOR_CLASS);
}
});
}
private _togglePointerEvents(touching: boolean): void {
if (touching) {
addCssClass(this._selectedArea.nativeElement, 'dt-no-pointer');
} else {
removeCssClass(this._selectedArea.nativeElement, 'dt-no-pointer');
}
}
private _reflectRangeValid(): void {
if (!this._valid) {
addCssClass(this._elementRef.nativeElement, DT_RANGE_INVALID_CLASS);
} else {
removeCssClass(this._elementRef.nativeElement, DT_RANGE_INVALID_CLASS);
}
}
private _createGlobalContainerInBody(): void {
const container = this._renderer.createElement('div');
addCssClass(container, 'dt-selection-area-global-container');
this._renderer.appendChild(document.body, container);
globalContainerElement = container;
}
}
private _applyAttributesAndClassesToPlotBackground(): void {
this._plotBackground = this._chart.container.nativeElement.querySelector(
'.highcharts-plot-background',
) as SVGRectElement;
addCssClass(this._plotBackground, 'dt-selection-area-origin-cursor');
this._plotBackground.setAttribute('tabindex', this.tabIndex.toString());
}
private _toggleOpenClass(isOpen: boolean): void {
if (isOpen) {
addCssClass(this._elementRef.nativeElement, DT_DRAWER_OPEN_CLASS);
} else {
removeCssClass(this._elementRef.nativeElement, DT_DRAWER_OPEN_CLASS);
}
}
private _onInputFocusChange(focusOrigin: FocusOrigin): void {
const element = this._elementRef.nativeElement;
if (focusOrigin === 'keyboard') {
addCssClass(element, 'dt-radio-focused', this._renderer);
} else if (!focusOrigin) {
removeCssClass(element, 'dt-radio-focused', this._renderer);
if (this._radioGroup) {
this._radioGroup._touch();
}
}
}
}