fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
smartxml: caching text nodes via expando
[fnpeditor.git]
/
src
/
smartxml
/
smartxml.js
diff --git
a/src/smartxml/smartxml.js
b/src/smartxml/smartxml.js
index
9cff5ec
..
c0b3c42
100644
(file)
--- a/
src/smartxml/smartxml.js
+++ b/
src/smartxml/smartxml.js
@@
-280,6
+280,7
@@
$.extend(ElementNode.prototype, {
var TextNode = function(nativeNode, document) {
DocumentNode.call(this, nativeNode, document);
var TextNode = function(nativeNode, document) {
DocumentNode.call(this, nativeNode, document);
+ nativeNode.__smartxmlTextNodeInstance = this;
};
TextNode.prototype = Object.create(DocumentNode.prototype);
};
TextNode.prototype = Object.create(DocumentNode.prototype);
@@
-360,7
+361,8
@@
$.extend(Document.prototype, Backbone.Events, fragments, {
var cached;
if(from instanceof Node) {
var cached;
if(from instanceof Node) {
- cached = ($(from).data(privateKey) || {}).node;
+ /* globals Text */
+ cached = from instanceof Text ? from.__smartxmlTextNodeInstance : ($(from).data(privateKey) || {}).node;
if(cached instanceof DocumentNode) {
return cached;
}
if(cached instanceof DocumentNode) {
return cached;
}