X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/8464a511c74dff643095ce419659df60b0580b7a..2ceaf44955f0f54fa0336978586bb8d9f4d7890b:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 712c0ad..fc9715b 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -242,12 +242,18 @@ $.extend(ElementNode.prototype, { return this.nativeNode.tagName.toLowerCase(); }, - contents: function() { + contents: function(selector) { var toret = [], document = this.document; - this._$.contents().each(function() { - toret.push(document.createDocumentNode(this)); - }); + if(selector) { + this._$.children(selector).each(function() { + toret.push(document.createDocumentNode(this)); + }); + } else { + this._$.contents().each(function() { + toret.push(document.createDocumentNode(this)); + }); + } return toret; },