Skip to content

Commit 7e9da7f

Browse files
committed
chore: lint fixes
1 parent 07017b0 commit 7e9da7f

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/components/datatable.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ export class DatatableComponent implements OnInit, AfterViewInit, DoCheck {
948948
return Object.assign({}, c);
949949
});
950950

951-
let prevCol = cols[newValue];
951+
const prevCol = cols[newValue];
952952
cols[newValue] = column;
953953
cols[prevValue] = prevCol;
954954

src/directives/draggable.directive.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ export class DraggableDirective implements OnDestroy, OnChanges {
3333
this.element = element.nativeElement;
3434
}
3535

36+
ngOnChanges(changes): void {
37+
if(changes['dragEventTarget'] && changes['dragEventTarget'].currentValue && this.dragModel.dragging) {
38+
this.onMousedown(changes['dragEventTarget'].currentValue);
39+
}
40+
}
41+
3642
ngOnDestroy(): void {
3743
this._destroySubscription();
3844
}
@@ -53,12 +59,6 @@ export class DraggableDirective implements OnDestroy, OnChanges {
5359
}
5460
}
5561

56-
ngOnChanges(changes) {
57-
if(changes['dragEventTarget'] && changes['dragEventTarget'].currentValue && this.dragModel.dragging) {
58-
this.onMousedown(changes['dragEventTarget'].currentValue)
59-
}
60-
}
61-
6262
onMousedown(event: MouseEvent): void {
6363
if ((<HTMLElement>event.target).classList.contains('draggable')) {
6464
event.preventDefault();
@@ -104,7 +104,7 @@ export class DraggableDirective implements OnDestroy, OnChanges {
104104
}
105105
}
106106

107-
private _destroySubscription() {
107+
private _destroySubscription(): void {
108108
if (this.subscription) {
109109
this.subscription.unsubscribe();
110110
this.subscription = undefined;

src/directives/long-press.directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class LongPressDirective implements OnDestroy {
5454
this.timeout = setTimeout(() => {
5555
this.isLongPressing = true;
5656
this.longPressStart.emit({
57-
event: event,
57+
event,
5858
model: this.pressModel
5959
});
6060

@@ -85,7 +85,7 @@ export class LongPressDirective implements OnDestroy {
8585
if (this.isLongPressing) {
8686
this.timeout = setTimeout(() => {
8787
this.longPressing.emit({
88-
event: event,
88+
event,
8989
model: this.pressModel
9090
});
9191
this.loop(event);
@@ -100,7 +100,7 @@ export class LongPressDirective implements OnDestroy {
100100
this._destroySubscription();
101101

102102
this.longPressEnd.emit({
103-
event: event,
103+
event,
104104
model: this.pressModel
105105
});
106106
}

src/directives/orderable.directive.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ export class OrderableDirective implements AfterContentInit, OnDestroy {
6666
let i = 0;
6767
for (const dragger of this.draggables.toArray()) {
6868
const elm = dragger.element;
69-
let left = parseInt(elm.offsetLeft.toString(), 0);
69+
const left = parseInt(elm.offsetLeft.toString(), 0);
7070
this.positions[ dragger.dragModel.prop ] = {
71-
left: left,
71+
left,
7272
right: left + parseInt(elm.offsetWidth.toString(), 0),
7373
index: i++,
7474
element: elm
7575
};
7676
}
7777
}
7878

79-
onDragEnd({ element, model, event }: any) {
79+
onDragEnd({ element, model, event }: any): void {
8080
const prevPos = this.positions[ model.prop ];
8181

82-
let target = this.isTarget(model, event);
82+
const target = this.isTarget(model, event);
8383
if (target) {
8484
this.reorder.emit({
8585
prevIndex: prevPos.index,
@@ -91,19 +91,19 @@ export class OrderableDirective implements AfterContentInit, OnDestroy {
9191
element.style.left = 'auto';
9292
}
9393

94-
isTarget(model, event) {
94+
isTarget(model, event): any {
9595
let i = 0;
96-
let targets = this.document.elementsFromPoint(event.x, event.y);
96+
const targets = this.document.elementsFromPoint(event.x, event.y);
9797

9898
for (const prop in this.positions) {
9999
// current column position which throws event.
100100
const pos = this.positions[ prop ];
101101

102102
// since we drag the inner span, we need to find it in the elements at the cursor
103-
if (model.prop != prop && targets.find((el) => el === pos.element)) {
103+
if (model.prop !== prop && targets.find((el) => el === pos.element)) {
104104
return {
105-
pos: pos,
106-
i: i
105+
pos,
106+
i
107107
};
108108
}
109109

0 commit comments

Comments
 (0)