|
@@ -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);
|
|
|
+}
|