X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=docs%2Fsrc%2FRoo_htmleditor_FilterEmpty.js.html;fp=docs%2Fsrc%2FRoo_htmleditor_FilterEmpty.js.html;h=3a72f21092374e7804ea13ee64df7b28c7e4df79;hp=0000000000000000000000000000000000000000;hb=93e6e2297355e6c84d5828a36a07c8adaad86743;hpb=8cd3f1abd9357f6b173fbca3cd7324e88b3450ff diff --git a/docs/src/Roo_htmleditor_FilterEmpty.js.html b/docs/src/Roo_htmleditor_FilterEmpty.js.html new file mode 100644 index 0000000000..3a72f21092 --- /dev/null +++ b/docs/src/Roo_htmleditor_FilterEmpty.js.html @@ -0,0 +1,44 @@ +Roo/htmleditor/FilterEmpty.js/** + * @class Roo.htmleditor.FilterEmpty + * filter empty elements + * @constructor + * Run a new Empty Filter + * @param {Object} config Configuration options + */ + +Roo.htmleditor.FilterEmpty = function(cfg) +{ + // no need to apply config. + this.walk(cfg.node); +} + +Roo.extend(Roo.htmleditor.FilterEmpty, Roo.htmleditor.FilterBlack, +{ + + tag : true, + + + replaceTag : function(node) + { + // start from leaf node + if(node.hasChildNodes()) { + this.walk(node); + } + + // only filter empty leaf element with certain tags + if( + ['B', 'I', 'U', 'S'].indexOf(node.tagName) < 0 + || + node.attributes && node.attributes.length > 0 + || + node.hasChildNodes() + ) { + return false; // don't walk + } + + Roo.htmleditor.FilterBlack.prototype.replaceTag.call(this, node); + return false; // don't walk + + } + +}); \ No newline at end of file