Revision 57665
Added by Konstantinos Triantafyllou over 4 years ago
click-outside-or-esc.directive.ts | ||
---|---|---|
14 | 14 |
private subscriptions: any[] = []; |
15 | 15 |
@Input() |
16 | 16 |
public targetId = null; |
17 |
@Input() |
|
18 |
public escClose = true; |
|
17 | 19 |
|
18 | 20 |
@Output('clickOutside') clickOutside: EventEmitter<Object>; |
19 | 21 |
|
... | ... | |
38 | 40 |
.do(() => { |
39 | 41 |
this.listening = true; |
40 | 42 |
}).subscribe((event: KeyboardEvent) => { |
41 |
if (event.keyCode === 27) { |
|
43 |
if (event.keyCode === 27 && this.escClose) {
|
|
42 | 44 |
this.clickOutside.emit({ |
43 | 45 |
target: (event.target || null), |
44 | 46 |
value: true |
Also available in: Unified diff
[Library]: Make modal works with uikit js. Add deep copy custom function