From this question, i know how to move an item up:
moveUp: function(category) {
var i = categories.indexOf(category);
if (i >= 1) {
var array = categories();
categories.splice(i-1, 2, array[i], array[i-1]);
}
}
What is the equivalent for moving the item down?
In this solution, i delete two items, from
index
position, and then again insert them (first - the next item, and the second - moving item):Demo