wlxml: Allow for setting non-function properties via extension
[fnpeditor.git] / src / wlxml / wlxml.js
index 5194c19..bbd6233 100644 (file)
@@ -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[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') || '';
     },
+    getClassHierarchy: function() {
+        return getClassLists(this.getClass());
+    },
     setClass: function(klass) {
         if(klass !== this.klass) {
             installObject(this, klass);
@@ -384,7 +389,8 @@ return {
         return this.WLXMLDocumentFromXML(xml).root;
     },
 
-    WLXMLDocument: WLXMLDocument
+    WLXMLDocument: WLXMLDocument,
+    getClassHierarchy: getClassLists
 };
 
 });
\ No newline at end of file