File tree 1 file changed +4
-5
lines changed
projects/ng-sortgrid/src/lib/sort/reflection
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
- import { Injectable } from '@angular/core' ;
1
+ import { Injectable } from '@angular/core' ;
2
2
3
3
import { NgsgElementsHelper } from '../../helpers/element/ngsg-elements.helper' ;
4
4
import { NgsgDragelement } from '../../shared/ngsg-dragelement.model' ;
@@ -8,16 +8,15 @@ import {NgsgStoreService} from '../../store/ngsg-store.service';
8
8
providedIn : 'root'
9
9
} )
10
10
export class NgsgReflectService {
11
- constructor ( private ngsgStore : NgsgStoreService ) { }
11
+ constructor ( private ngsgStore : NgsgStoreService ) {
12
+ }
12
13
13
14
public reflectChanges ( key : string , element : Element ) : any [ ] {
14
15
const items = this . ngsgStore . getItems ( key ) ;
15
16
const selectedElements = this . ngsgStore . getSelectedItems ( key ) ;
16
17
const selectedElementIndices = this . getSelectedElementsIndices ( selectedElements ) ;
17
18
const selectedItems = this . getSelectedItems ( items , selectedElementIndices ) ;
18
- const sortedIndices = selectedElementIndices . sort ( function ( a , b ) {
19
- return a - b ;
20
- } ) ;
19
+ const sortedIndices = selectedElementIndices . sort ( ( a , b ) => a - b ) ;
21
20
const dropIndex = this . findDropIndex ( selectedElements , element ) ;
22
21
23
22
while ( sortedIndices . length > 0 ) {
You can’t perform that action at this time.
0 commit comments