Index: trunk/parsers/wikidom/lib/hype/bases/es.ModelNode.js |
— | — | @@ -207,6 +207,31 @@ |
208 | 208 | }; |
209 | 209 | |
210 | 210 | /** |
| 211 | + * Sets the root node to this and all of it's children. |
| 212 | + * |
| 213 | + * @method |
| 214 | + * @param {es.ModelNode} root Node to use as root |
| 215 | + */ |
| 216 | +es.ModelNode.prototype.setRoot = function( root ) { |
| 217 | + this.root = root; |
| 218 | + for ( var i = 0; i < this.length; i++ ) { |
| 219 | + this[i].setRoot( root ); |
| 220 | + } |
| 221 | +}; |
| 222 | + |
| 223 | +/** |
| 224 | + * Clears the root node from this and all of it's children. |
| 225 | + * |
| 226 | + * @method |
| 227 | + */ |
| 228 | +es.ModelNode.prototype.clearRoot = function() { |
| 229 | + this.root = null; |
| 230 | + for ( var i = 0; i < this.length; i++ ) { |
| 231 | + this[i].clearRoot(); |
| 232 | + } |
| 233 | +}; |
| 234 | + |
| 235 | +/** |
211 | 236 | * Attaches this node to another as a child. |
212 | 237 | * |
213 | 238 | * @method |
— | — | @@ -234,31 +259,6 @@ |
235 | 260 | }; |
236 | 261 | |
237 | 262 | /** |
238 | | - * Sets the root node to this and all of it's children. |
239 | | - * |
240 | | - * @method |
241 | | - * @param {es.ModelNode} root Node to use as root |
242 | | - */ |
243 | | -es.ModelNode.prototype.setRoot = function( root ) { |
244 | | - this.root = root; |
245 | | - for ( var i = 0; i < this.length; i++ ) { |
246 | | - this[i].setRoot( root ); |
247 | | - } |
248 | | -}; |
249 | | - |
250 | | -/** |
251 | | - * Clears the root node from this and all of it's children. |
252 | | - * |
253 | | - * @method |
254 | | - */ |
255 | | -es.ModelNode.prototype.clearRoot = function() { |
256 | | - this.root = null; |
257 | | - for ( var i = 0; i < this.length; i++ ) { |
258 | | - this[i].clearRoot(); |
259 | | - } |
260 | | -}; |
261 | | - |
262 | | -/** |
263 | 263 | * Creates a view for this node. |
264 | 264 | * |
265 | 265 | * @method |