X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a48175e69474b76a9aa2443ec7b2e8e9d68df1aa..06c0fd3da81bed89e12e7a30cfc6ff33ddecd075:/project/static/js/lib/codemirror/util.js diff --git a/project/static/js/lib/codemirror/util.js b/project/static/js/lib/codemirror/util.js index 61f927d1..0cd91d4e 100644 --- a/project/static/js/lib/codemirror/util.js +++ b/project/static/js/lib/codemirror/util.js @@ -114,3 +114,21 @@ function addEventHandler(node, type, handler, removeFunc) { function nodeText(node) { return node.textContent || node.innerText || node.nodeValue || ""; } + +function nodeTop(node) { + var top = 0; + while (node.offsetParent) { + top += node.offsetTop; + node = node.offsetParent; + } + return top; +} + +function isBR(node) { + var nn = node.nodeName; + return nn == "BR" || nn == "br"; +} +function isSpan(node) { + var nn = node.nodeName; + return nn == "SPAN" || nn == "span"; +}