Roo.CompositeElement.prototype = {
isComposite: true,
addElements : function(els){
- if(!els) return this;
+ if(!els) {
+ return this;
+ }
if(typeof els == "string"){
els = Roo.Element.selectorFunction(els);
}
/**
* Filters this composite to only elements that match the passed selector.
* @param {String} selector A string CSS selector
+ * @param {Boolean} inverse return inverse filter (not matches)
* @return {CompositeElement} this
*/
- filter : function(selector){
+ filter : function(selector, inverse){
var els = [];
+ inverse = inverse || false;
this.each(function(el){
- if(el.is(selector)){
+ var match = inverse ? !el.is(selector) : el.is(selector);
+ if(match){
els[els.length] = el.dom;
}
});