From 5529645ff3677885ce85f6fb17ce1cd02b3baca0 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 6 Oct 2015 10:26:49 +0200 Subject: [PATCH] Recycle highlights --- src/highlights-component.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/highlights-component.coffee b/src/highlights-component.coffee index 70e8d4acc..a6e85b7e5 100644 --- a/src/highlights-component.coffee +++ b/src/highlights-component.coffee @@ -21,7 +21,7 @@ class HighlightsComponent # remove highlights for id of @oldState unless newState[id]? - @highlightNodesById[id].remove() + @domElementPool.freeElementAndDescendants(@highlightNodesById[id]) delete @highlightNodesById[id] delete @regionNodesByHighlightId[id] delete @oldState[id] @@ -66,7 +66,7 @@ class HighlightsComponent # remove regions while oldHighlightState.regions.length > newHighlightState.regions.length oldHighlightState.regions.pop() - @regionNodesByHighlightId[id][oldHighlightState.regions.length].remove() + @domElementPool.freeElementAndDescendants(@regionNodesByHighlightId[id][oldHighlightState.regions.length]) delete @regionNodesByHighlightId[id][oldHighlightState.regions.length] # add or update regions