From 4be70c8942e80162c30c956cf6fb77fa8fc96409 Mon Sep 17 00:00:00 2001 From: kreuzerk Date: Wed, 24 Nov 2021 09:51:16 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20(sort)=20fix=20lint=20e?= =?UTF-8?q?rrors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lib/sort/reflection/ngsg-reflect.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/projects/ng-sortgrid/src/lib/sort/reflection/ngsg-reflect.service.ts b/projects/ng-sortgrid/src/lib/sort/reflection/ngsg-reflect.service.ts index fea2e20..df2613d 100644 --- a/projects/ng-sortgrid/src/lib/sort/reflection/ngsg-reflect.service.ts +++ b/projects/ng-sortgrid/src/lib/sort/reflection/ngsg-reflect.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import {Injectable} from '@angular/core'; import {NgsgElementsHelper} from '../../helpers/element/ngsg-elements.helper'; import {NgsgDragelement} from '../../shared/ngsg-dragelement.model'; @@ -8,16 +8,15 @@ import {NgsgStoreService} from '../../store/ngsg-store.service'; providedIn: 'root' }) export class NgsgReflectService { - constructor(private ngsgStore: NgsgStoreService) {} + constructor(private ngsgStore: NgsgStoreService) { + } public reflectChanges(key: string, element: Element): any[] { const items = this.ngsgStore.getItems(key); const selectedElements = this.ngsgStore.getSelectedItems(key); const selectedElementIndices = this.getSelectedElementsIndices(selectedElements); const selectedItems = this.getSelectedItems(items, selectedElementIndices); - const sortedIndices = selectedElementIndices.sort(function(a,b) { - return a - b; - }); + const sortedIndices = selectedElementIndices.sort((a, b) => a - b); const dropIndex = this.findDropIndex(selectedElements, element); while (sortedIndices.length > 0) {