reordering JS tree