From 4c8ce65ce73e2d00d17df27e2dbe4463b318c4a4 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 28 Mar 2017 16:50:30 +0100 Subject: [PATCH] Allo overlapping comments --- .../controllers/ReviewPanelController.coffee | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee index 5067799571..2af97a440e 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -288,18 +288,11 @@ define [ delete entries["add-comment"] if selection - # Only show add comment if we're not already overlapping one - overlapping_comment = false - for id, entry of entries - if entry.type == "comment" and not $scope.reviewPanel.resolvedThreadIds[entry.thread_id] - unless entry.offset >= selection_offset_end or entry.offset + entry.content.length <= selection_offset_start - overlapping_comment = true - if !overlapping_comment - entries["add-comment"] = { - type: "add-comment" - offset: selection_offset_start - length: selection_offset_end - selection_offset_start - } + entries["add-comment"] = { + type: "add-comment" + offset: selection_offset_start + length: selection_offset_end - selection_offset_start + } for id, entry of entries if entry.type == "comment" and not $scope.reviewPanel.resolvedThreadIds[entry.thread_id]