From d607f7e5c2d098858d54c31ba12201eaea08cbe4 Mon Sep 17 00:00:00 2001 From: Nandor Elod Fekete Date: Mon, 7 Dec 2015 15:51:44 +0100 Subject: [PATCH] fix for https://github.com/timdown/rangy/issues/363 --- src/modules/rangy-selectionsaverestore.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/rangy-selectionsaverestore.js b/src/modules/rangy-selectionsaverestore.js index 9343daec..dcfa02bc 100644 --- a/src/modules/rangy-selectionsaverestore.js +++ b/src/modules/rangy-selectionsaverestore.js @@ -217,10 +217,10 @@ rangy.createModule("SaveRestore", ["WrappedSelection"], function(api, module) { for (var i = 0, len = rangeInfos.length, rangeInfo; i < len; ++i) { rangeInfo = rangeInfos[i]; if (rangeInfo.collapsed) { - removeMarkerElement(savedSelection.doc, rangeInfo.markerId); + removeMarkerElement(rangeInfo.document, rangeInfo.markerId); } else { - removeMarkerElement(savedSelection.doc, rangeInfo.startMarkerId); - removeMarkerElement(savedSelection.doc, rangeInfo.endMarkerId); + removeMarkerElement(rangeInfo.document, rangeInfo.startMarkerId); + removeMarkerElement(rangeInfo.document, rangeInfo.endMarkerId); } } }