fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wip: canvas.commands - lists through new api
[fnpeditor.git]
/
src
/
smartxml
/
smartxml.js
diff --git
a/src/smartxml/smartxml.js
b/src/smartxml/smartxml.js
index
60ed6a0
..
47c527f
100644
(file)
--- a/
src/smartxml/smartxml.js
+++ b/
src/smartxml/smartxml.js
@@
-10,9
+10,6
@@
define([
'use strict';
/* globals Node */
'use strict';
/* globals Node */
-var TEXT_NODE = Node.TEXT_NODE;
-
-
var DocumentNode = function(nativeNode, document) {
if(!document) {
var DocumentNode = function(nativeNode, document) {
if(!document) {
@@
-48,6
+45,10
@@
$.extend(DocumentNode.prototype, {
},
getPath: function(ancestor) {
},
getPath: function(ancestor) {
+ if(!(this.document.containsNode(this))) {
+ return null;
+ }
+
var nodePath = [this].concat(this.parents()),
toret, idx;
ancestor = ancestor || this.document.root;
var nodePath = [this].concat(this.parents()),
toret, idx;
ancestor = ancestor || this.document.root;
@@
-265,6
+266,8
@@
var Document = function(xml) {
this._nodeTransformations = {};
this._textNodeTransformations = {};
this._elementNodeTransformations = {};
this._nodeTransformations = {};
this._textNodeTransformations = {};
this._elementNodeTransformations = {};
+
+ this.registerExtension(coreTransformations);
};
$.extend(Document.prototype, Backbone.Events, {
};
$.extend(Document.prototype, Backbone.Events, {
@@
-477,7
+480,6
@@
$.extend(Document.prototype, Backbone.Events, {
return {
documentFromXML: function(xml) {
var doc = new Document(xml);
return {
documentFromXML: function(xml) {
var doc = new Document(xml);
- doc.registerExtension(coreTransformations);
return doc;
},
return doc;
},