From c01624abe93808e7eef31bbdd19c2bd8d72bf710 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 23 Oct 2015 21:19:37 -0400 Subject: [PATCH] Map ranges and stuff correctly. --- prototype/UI/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prototype/UI/index.html b/prototype/UI/index.html index 8656be8c7..f4f56130c 100644 --- a/prototype/UI/index.html +++ b/prototype/UI/index.html @@ -91,10 +91,12 @@ /// Diff -> String -> String -> DOM function diffToDOM(diff, which, source) { - return rangeAndSyntaxToDOM(diff.roll.extract[which], diff.roll.unwrap, source, function(diff) { + if (diff.pure != null) { return diff.pure; } + function getRange(diff) { if (diff.pure != null) { return diff.pure["data-range"]; } if (diff.roll != null) { return diff.roll.extract[which]; } - }, function(diff) { return diffToDOM(diff, which, source); }) + } + return rangeAndSyntaxToDOM(getRange(diff), diff.roll.unwrap, source, getRange, function(diff) { return diffToDOM(diff, which, source); }) } /// Range -> Syntax a -> String -> (a -> Range) -> (a -> DOM) -> DOM