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.
26 lines
594 B
26 lines
594 B
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { Directive, HostListener, Input } from '@angular/core';
|
|
|
|
@Directive({
|
|
selector: '[sqxStopClick]'
|
|
})
|
|
export class StopClickDirective {
|
|
@Input('sqxStopClick')
|
|
public shouldStop = true;
|
|
|
|
@HostListener('click', ['$event'])
|
|
public onClick(event: Event) {
|
|
const shouldStop: any = this.shouldStop;
|
|
|
|
if (shouldStop || shouldStop === '') {
|
|
event.stopPropagation();
|
|
event.stopImmediatePropagation();
|
|
}
|
|
}
|
|
}
|