| 138 | | // simpleQuery may be a CSS class, ID, attribute, or pseudo |
| 139 | | // selector that further filters the contents of this NodeList. |
| 140 | | // A new NodeList with the resulting elements is returned. |
| 141 | | /* |
| 142 | | var orphans = dojo._filterQueryResult(this, simpleFilter); |
| 143 | | orphans.forEach(function(item){ |
| 144 | | if(item["parentNode"]){ |
| 145 | | item.parentNode.removeChild(item); |
| | 142 | var items = this; |
| | 143 | if(typeof arguments[0] == "string"){ |
| | 144 | items = dojo._filterQueryResult(this, arguments[0]); |
| | 145 | if(arguments.length == 1){ |
| | 146 | return items; |
| | 170 | var dl = d.lang; |
| | 171 | // make sure that it has all the JS 1.6 things we need before we subclass |
| | 172 | dl.extend(dojo.NodeList, |
| | 173 | { |
| | 174 | // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array#Methods |
| | 175 | // must implement the following JS 1.6 methods: |
| | 176 | |
| | 177 | // fixme: we can't use hitch here as it binds to an object, |
| | 178 | // which we don't want. Time for a real partial() ? |
| | 179 | forEach: function(callback, thisObj){ |
| | 180 | return dl.forEach(this, callback, thisObj); |
| | 181 | }, |
| | 182 | |
| | 183 | every: function(callback, thisObj){ |
| | 184 | return dl.every(this, callback, thisObj); |
| | 185 | }, |
| | 186 | |
| | 187 | some: function(callback, thisObj){ |
| | 188 | return dl.some(this, callback, thisObj); |
| | 189 | }, |
| | 190 | |
| | 191 | map: function(obj, unary_func){ |
| | 192 | return dl.map(this, obj, unary_func); |
| | 193 | } |
| | 194 | |
| | 195 | // NOTE: filter() is handled in NodeList by default |
| | 196 | } |
| | 197 | ); |
| | 198 | |
| | 199 | |
| | 200 | |