forked from CuppaLabs/angular2-multiselect-dropdown
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclickOutside.js
More file actions
110 lines (110 loc) · 3.43 KB
/
clickOutside.js
File metadata and controls
110 lines (110 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import { Directive, ElementRef, Output, EventEmitter, HostListener, Input } from '@angular/core';
var ClickOutsideDirective = (function () {
function ClickOutsideDirective(_elementRef) {
this._elementRef = _elementRef;
this.clickOutside = new EventEmitter();
}
ClickOutsideDirective.prototype.onClick = function (event, targetElement) {
if (!targetElement) {
return;
}
var clickedInside = this._elementRef.nativeElement.contains(targetElement);
if (!clickedInside) {
this.clickOutside.emit(event);
}
};
return ClickOutsideDirective;
}());
export { ClickOutsideDirective };
ClickOutsideDirective.decorators = [
{ type: Directive, args: [{
selector: '[clickOutside]'
},] },
];
/** @nocollapse */
ClickOutsideDirective.ctorParameters = function () { return [
{ type: ElementRef, },
]; };
ClickOutsideDirective.propDecorators = {
'clickOutside': [{ type: Output },],
'onClick': [{ type: HostListener, args: ['document:click', ['$event', '$event.target'],] }, { type: HostListener, args: ['document:touchstart', ['$event', '$event.target'],] },],
};
var ScrollDirective = (function () {
function ScrollDirective(_elementRef) {
this._elementRef = _elementRef;
this.scroll = new EventEmitter();
}
ScrollDirective.prototype.onClick = function (event, targetElement) {
this.scroll.emit(event);
};
return ScrollDirective;
}());
export { ScrollDirective };
ScrollDirective.decorators = [
{ type: Directive, args: [{
selector: '[scroll]'
},] },
];
/** @nocollapse */
ScrollDirective.ctorParameters = function () { return [
{ type: ElementRef, },
]; };
ScrollDirective.propDecorators = {
'scroll': [{ type: Output },],
'onClick': [{ type: HostListener, args: ['scroll', ['$event'],] },],
};
var styleDirective = (function () {
function styleDirective(el) {
this.el = el;
}
styleDirective.prototype.ngOnInit = function () {
this.el.nativeElement.style.top = this.styleVal;
};
styleDirective.prototype.ngOnChanges = function () {
this.el.nativeElement.style.top = this.styleVal;
};
return styleDirective;
}());
export { styleDirective };
styleDirective.decorators = [
{ type: Directive, args: [{
selector: '[styleProp]'
},] },
];
/** @nocollapse */
styleDirective.ctorParameters = function () { return [
{ type: ElementRef, },
]; };
styleDirective.propDecorators = {
'styleVal': [{ type: Input, args: ['styleProp',] },],
};
var setPosition = (function () {
function setPosition(el) {
this.el = el;
}
setPosition.prototype.ngOnInit = function () {
if (this.height) {
this.el.nativeElement.style.bottom = parseInt(this.height + 15 + "") + 'px';
}
};
setPosition.prototype.ngOnChanges = function () {
if (this.height) {
this.el.nativeElement.style.bottom = parseInt(this.height + 15 + "") + 'px';
}
};
return setPosition;
}());
export { setPosition };
setPosition.decorators = [
{ type: Directive, args: [{
selector: '[setPosition]'
},] },
];
/** @nocollapse */
setPosition.ctorParameters = function () { return [
{ type: ElementRef, },
]; };
setPosition.propDecorators = {
'height': [{ type: Input, args: ['setPosition',] },],
};
//# sourceMappingURL=clickOutside.js.map