fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wlxml: Allow for setting non-function properties via extension
[fnpeditor.git]
/
src
/
wlxml
/
wlxml.js
diff --git
a/src/wlxml/wlxml.js
b/src/wlxml/wlxml.js
index
5194c19
..
bbd6233
100644
(file)
--- a/
src/wlxml/wlxml.js
+++ b/
src/wlxml/wlxml.js
@@
-58,7
+58,9
@@
var installObject = function(instance, klass) {
});
instance.object = Object.create(_.extend({}, methods, transformations));
_.keys(methods).concat(_.keys(transformations)).forEach(function(key) {
});
instance.object = Object.create(_.extend({}, methods, transformations));
_.keys(methods).concat(_.keys(transformations)).forEach(function(key) {
- instance.object[key] = _.bind(instance.object[key], instance);
+ if(_.isFunction(instance.object[key])) {
+ instance.object[key] = _.bind(instance.object[key], instance);
+ }
});
};
});
};
@@
-72,6
+74,9
@@
$.extend(WLXMLElementNode.prototype, WLXMLDocumentNodeMethods, smartxml.ElementN
getClass: function() {
return this.getAttr('class') || '';
},
getClass: function() {
return this.getAttr('class') || '';
},
+ getClassHierarchy: function() {
+ return getClassLists(this.getClass());
+ },
setClass: function(klass) {
if(klass !== this.klass) {
installObject(this, klass);
setClass: function(klass) {
if(klass !== this.klass) {
installObject(this, klass);
@@
-384,7
+389,8
@@
return {
return this.WLXMLDocumentFromXML(xml).root;
},
return this.WLXMLDocumentFromXML(xml).root;
},
- WLXMLDocument: WLXMLDocument
+ WLXMLDocument: WLXMLDocument,
+ getClassHierarchy: getClassLists
};
});
\ No newline at end of file
};
});
\ No newline at end of file