--- a/src/cm/media/js/client/c_sync.js Tue May 15 09:36:18 2012 +0200
+++ b/src/cm/media/js/client/c_sync.js Tue May 15 11:16:46 2012 +0200
@@ -483,6 +483,16 @@
checkForOpenedDialog(null, function() {
gShowingAllComments = true ;
var allTopComments = CY.Array.map(gDb.comments, function(c){return c.id;}) ;
+ // Reorder if by scope.
+ if (parent.$("#browse_by").val() == 'scope') {
+ allTopComments.sort(function (a,b) {
+ if (gDb.ordered_comment_ids['scope'].indexOf(a) < gDb.ordered_comment_ids['scope'].indexOf(b))
+ return -1;
+ if (gDb.ordered_comment_ids['scope'].indexOf(a) > gDb.ordered_comment_ids['scope'].indexOf(b))
+ return 1
+ return 0
+ });
+ }
// GIB: go down the 'add comment' icon
this.showComments(allTopComments, [0,30], true) ;
}, this, null) ;
@@ -493,6 +503,16 @@
gShowingAllComments = true ;
var scopeRemovedComments = CY.Array.filter(gDb.comments, function(comment) { return (comment.start_wrapper == -1) ; }) ;
var scopeRemovedCommentIds = CY.Array.map(scopeRemovedComments, function(c){return c.id;}) ;
+ // Reorder if by scope.
+ if (parent.$("#browse_by").val() == 'scope') {
+ scopeRemovedCommentIds.sort(function (a,b) {
+ if (gDb.ordered_comment_ids['scope'].indexOf(a) < gDb.ordered_comment_ids['scope'].indexOf(b))
+ return -1;
+ if (gDb.ordered_comment_ids['scope'].indexOf(a) > gDb.ordered_comment_ids['scope'].indexOf(b))
+ return 1
+ return 0
+ });
+ }
// GIB: go down the 'add comment' icon
this.showComments(scopeRemovedCommentIds, [0,30], true) ;