X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a48175e69474b76a9aa2443ec7b2e8e9d68df1aa..8b3b5216a1690aff61e4da42a2523406fd8b21e3:/project/static/js/lib/codemirror/util.js?ds=sidebyside 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"; +}