Skip to content

Instantly share code, notes, and snippets.

@iksnae
Created July 24, 2013 19:00
Show Gist options
  • Save iksnae/6073444 to your computer and use it in GitHub Desktop.
Save iksnae/6073444 to your computer and use it in GitHub Desktop.
mb shifting
var moodboards_order_array = [];
function onMoveMoodboardUp(mb_index)
{
switch(getMoodboardFilteringMode())
{
case true:
// shift filtered
shiftMoodBoardsFiltered(mb_index,-1);
break;
case false:
// shift unfiltered
shiftMoodBoardsFiltered(mb_index,-1);
break;
}
}
function shiftMoodBoardsFiltered(index,direction)
{
var to = index+direction;
var from = index;
// TODO: account for inactive.
moodboards_order_array.splice(to, 0, this.splice(from, 1)[0]);
}
function shiftMoodBoardsUnfiltered(index,direction)
{
var to = index+direction;
var from = index;
moodboards_order_array.splice(to, 0, this.splice(from, 1)[0]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment