X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/2687ec6cbbe8101a4faa232c79f5c1321dcebe6d..b53d709d888332da35d991ef449ddfc60633273f:/src/wlxml/wlxml.js diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index 5194c19..bbd6233 100644 --- 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[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