From: Aleksander Ɓukasz Date: Mon, 24 Mar 2014 11:28:32 +0000 (+0100) Subject: wlxml: allow extending WLXMLDocument X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/e1acb388e008f83e89976e3779330d2a268f525e wlxml: allow extending WLXMLDocument --- diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index 4f6e356..034312d 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -343,14 +343,17 @@ var wlxmlClasses = { return { - WLXMLDocumentFromXML: function(xml, options) { + WLXMLDocumentFromXML: function(xml, options, Factory) { options = _.extend({wlxmlClasses: wlxmlClasses}, options); - return new WLXMLDocument(xml, options); + Factory = Factory || WLXMLDocument; + return new Factory(xml, options); }, WLXMLElementNodeFromXML: function(xml) { return this.WLXMLDocumentFromXML(xml).root; - } + }, + + WLXMLDocument: WLXMLDocument }; }); \ No newline at end of file