| OLD | NEW |
| 1 part of angular.core.dom; | 1 part of angular.core.dom; |
| 2 | 2 |
| 3 /** | 3 /** |
| 4 * ElementWrapper is an interface for [Block]s and [BlockHole]s. Its purpose is | 4 * ElementWrapper is an interface for [Block]s and [BlockHole]s. Its purpose is |
| 5 * to allow treating [Block] and [BlockHole] under same interface so that | 5 * to allow treating [Block] and [BlockHole] under same interface so that |
| 6 * [Block]s can be added after [BlockHole]. | 6 * [Block]s can be added after [BlockHole]. |
| 7 */ | 7 */ |
| 8 abstract class ElementWrapper { | 8 abstract class ElementWrapper { |
| 9 List<dom.Node> elements; | 9 List<dom.Node> elements; |
| 10 ElementWrapper next; | 10 ElementWrapper next; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 if (!preventDefault) { | 71 if (!preventDefault) { |
| 72 insertDomElements(); | 72 insertDomElements(); |
| 73 } | 73 } |
| 74 return this; | 74 return this; |
| 75 } | 75 } |
| 76 | 76 |
| 77 Block remove() { | 77 Block remove() { |
| 78 bool preventDefault = false; | 78 bool preventDefault = false; |
| 79 | 79 |
| 80 Function removeDomElements = () { | 80 Function removeDomElements = () { |
| 81 for (var j = 0; j < elements.length; j++) { | 81 for(var j = 0, jj = elements.length; j < jj; j++) { |
| 82 dom.Node current = elements[j]; | 82 dom.Node current = elements[j]; |
| 83 dom.Node next = j+1 < elements.length ? elements[j+1] : null; | 83 dom.Node next = j+1 < jj ? elements[j+1] : null; |
| 84 | 84 |
| 85 while(next != null && current.nextNode != next) { | 85 while(next != null && current.nextNode != next) { |
| 86 current.nextNode.remove(); | 86 current.nextNode.remove(); |
| 87 } | 87 } |
| 88 elements[j].remove(); | 88 elements[j].remove(); |
| 89 } | 89 } |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 if (onRemove != null) { | 92 if (onRemove != null) { |
| 93 onRemove({ | 93 onRemove({ |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 * and act as references which allows more blocks to be added. | 141 * and act as references which allows more blocks to be added. |
| 142 */ | 142 */ |
| 143 class BlockHole extends ElementWrapper { | 143 class BlockHole extends ElementWrapper { |
| 144 List<dom.Node> elements; | 144 List<dom.Node> elements; |
| 145 ElementWrapper previous; | 145 ElementWrapper previous; |
| 146 ElementWrapper next; | 146 ElementWrapper next; |
| 147 | 147 |
| 148 BlockHole(this.elements); | 148 BlockHole(this.elements); |
| 149 } | 149 } |
| 150 | 150 |
| OLD | NEW |