1
0
Kandrashin Denis 13 жил өмнө
parent
commit
d3ffd2be7d

+ 9 - 7
source/js/get_status.js

@@ -1,7 +1,9 @@
-(f = function(node){
-    var tag = node.tagName;
-    if (tag === 'BODY') return '';
-    if (tag === 'DIV') tag = node.getAttribute('CLASS');
-    return f(node.parentNode) + '/' + tag;
-})(document.getSelection().baseNode.parentNode);
-
+var baseNode = document.getSelection().baseNode;
+if (baseNode === null) ''; else {
+	(f = function(node){
+		var tag = node.tagName;
+		if (tag === 'BODY') return '';
+		if (tag === 'DIV') tag = node.getAttribute('CLASS');
+		return f(node.parentNode) + '/' + tag;
+	})(baseNode.parentNode);
+}