X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/e3daf6a78b558bb2d776b389ba65a58eea1de2be..b6a988bcb0532fa8bce3f1dab8862bb53ade7b3b:/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"; +}