feat(reorder): adds ion-reorder-group to core

This commit is contained in:
Manuel Mtz-Almeida
2017-09-20 11:44:27 +02:00
parent 52b3a4ce96
commit bdf4f60e9e
11 changed files with 606 additions and 31 deletions

View File

@ -268,3 +268,13 @@ export function hasFocusedTextInput() {
}
return false;
}
/**
* @private
*/
export function reorderArray(array: any[], indexes: {from: number, to: number}): any[] {
const element = array[indexes.from];
array.splice(indexes.from, 1);
array.splice(indexes.to, 0, element);
return array;
}