From f135f79d1315e7bf36e5f8a37cf1e61f340c601f Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 7 Apr 2013 19:06:15 +0100 Subject: [PATCH] only try to redraw the line height of lines that exist.. --- src/static/js/ace2_inner.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 067b546b..0d54d725 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -5180,7 +5180,6 @@ function Ace2Inner(){ { if(n > lineNumbersShown) //all updated, break break; - var h = (b.clientHeight || b.offsetHeight); if (b.nextSibling) { @@ -5215,17 +5214,23 @@ function Ace2Inner(){ var n = lineNumbersShown; var div = odoc.createElement("DIV"); //calculate height for new line number - var h = (b.clientHeight || b.offsetHeight); + if(b){ + var h = (b.clientHeight || b.offsetHeight); - if (b.nextSibling) - h = b.nextSibling.offsetTop - b.offsetTop; + if (b.nextSibling){ + h = b.nextSibling.offsetTop - b.offsetTop; + } + } - if(h) // apply style to div + if(h){ // apply style to div div.style.height = h +"px"; - + } + div.appendChild(odoc.createTextNode(String(n))); fragment.appendChild(div); - b = b.nextSibling; + if(b){ + b = b.nextSibling; + } } container.appendChild(fragment);