From a3c529d23f3757ffd54171b27d741158a0706a63 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 8 May 2017 16:10:08 +0100 Subject: [PATCH] Update range tracker with new bulk method. --- .../coffee/ide/review-panel/RangesTracker.coffee | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/web/public/coffee/ide/review-panel/RangesTracker.coffee b/services/web/public/coffee/ide/review-panel/RangesTracker.coffee index 14193f628d..f589098440 100644 --- a/services/web/public/coffee/ide/review-panel/RangesTracker.coffee +++ b/services/web/public/coffee/ide/review-panel/RangesTracker.coffee @@ -100,6 +100,21 @@ load = () -> change = @getChange(change_id) return if !change? @_removeChange(change) + + removeChangeIds: (change_to_remove_ids) -> + return if !change_to_remove_ids?.length > 0 + i = @changes.length + remove_change_id = {} + for change_id in change_to_remove_ids + remove_change_id[change_id] = true + + while (i--) + if remove_change_id[@changes[i].id] + delete remove_change_id[@changes[i].id] + removed_change = @changes.splice(i, 1)[0] + @_markAsDirty removed_change, "change", "removed" + if Object.keys(remove_change_id).length == 0 + break validate: (text) -> for change in @changes