feat(item): sliding items work with list reorder

This commit is contained in:
Manu Mtz.-Almeida
2016-06-23 21:17:25 +02:00
parent b7826ba1c1
commit bfdc898945
15 changed files with 493 additions and 348 deletions

View File

@@ -175,3 +175,11 @@ export function getQuerystring(url: string): any {
}
return queryParams;
}
export function reorderArray(array: any[], indexes: {from: number, to: number}): any[] {
let element = array[indexes.from];
array.splice(indexes.from, 1);
array.splice(indexes.to, 0, element);
return array;
}