mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
559 B
25 lines
559 B
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { Directive, HostListener, Input } from '@angular/core';
|
|
|
|
@Directive({
|
|
selector: '[sqxStopDrag]',
|
|
})
|
|
export class StopDragDirective {
|
|
@Input('sqxStopDrag')
|
|
public shouldStop: any = true;
|
|
|
|
@HostListener('dragstart', ['$event'])
|
|
public onDragStart(event: Event) {
|
|
const shouldStop: any = this.shouldStop;
|
|
|
|
if (shouldStop || shouldStop === '') {
|
|
event.preventDefault();
|
|
}
|
|
}
|
|
}
|
|
|