Skip to content

Commit

Permalink
Merge pull request sakaiproject#2315 from marktriggs/SAK-30906
Browse files Browse the repository at this point in the history
SAK-30906 Place newly added favorite sites after the others
  • Loading branch information
juanjmerono committed Apr 22, 2016
2 parents 8e29111 + cc4fd03 commit 5f4555a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,15 @@ $PBJQ(document).ready(function($){

var newFavorites = listFavorites();

// Retain the sort ordering of our original list
// Retain the sort ordering of our original list, adding new items to the end
newFavorites = newFavorites.sort(function (a, b) {
return favoritesList.indexOf(a) - favoritesList.indexOf(b);
if (favoritesList.indexOf(a) === -1) {
return 1;
} else if (favoritesList.indexOf(b) === -1) {
return -1;
} else {
return favoritesList.indexOf(a) - favoritesList.indexOf(b);
}
});

$.ajax({
Expand Down

0 comments on commit 5f4555a

Please sign in to comment.