@@ -18,10 +18,7 @@ abstract class ElementWrapper {
18
18
* contain other [Block] s and it is the only way in which DOM can be changed
19
19
* structurally.
20
20
*
21
- * A [Block] is a collection of DOM nodes and [Directive] s for those nodes.
22
- *
23
- * A [Block] is responsible for instantiating the [Directive] s and for
24
- * inserting / removing itself to/from DOM.
21
+ * A [Block] is a collection of DOM nodes
25
22
*
26
23
* A [Block] can be created from [BlockFactory] .
27
24
*
@@ -31,11 +28,6 @@ class Block implements ElementWrapper {
31
28
ElementWrapper next;
32
29
ElementWrapper previous;
33
30
34
- Function onInsert;
35
- Function onRemove;
36
- Function onMove;
37
-
38
- List <dynamic > _directives = [];
39
31
final NgAnimate _animate;
40
32
41
33
Block (this .elements, this ._animate);
@@ -54,49 +46,16 @@ class Block implements ElementWrapper {
54
46
dom.Node previousElement = previousElements[previousElements.length - 1 ];
55
47
dom.Node insertBeforeElement = previousElement.nextNode;
56
48
dom.Node parentElement = previousElement.parentNode;
57
- bool preventDefault = false ;
58
49
59
- Function insertDomElements = () {
60
- _animate.insert (elements, parentElement, insertBefore: insertBeforeElement);
61
- };
62
-
63
- if (onInsert != null ) {
64
- onInsert ({
65
- "preventDefault" : () {
66
- preventDefault = true ;
67
- return insertDomElements;
68
- },
69
- "element" : elements[0 ]
70
- });
71
- }
50
+ _animate.insert (elements, parentElement, insertBefore: insertBeforeElement);
72
51
73
- if (! preventDefault) {
74
- insertDomElements ();
75
- }
76
52
return this ;
77
53
}
78
54
79
55
Block remove () {
80
56
bool preventDefault = false ;
81
57
82
- Function removeDomElements = () {
83
- _animate.remove (elements);
84
- };
85
-
86
- if (onRemove != null ) {
87
- onRemove ({
88
- "preventDefault" : () {
89
- preventDefault = true ;
90
- removeDomElements ();
91
- return this ;
92
- },
93
- "element" : elements[0 ]
94
- });
95
- }
96
-
97
- if (! preventDefault) {
98
- removeDomElements ();
99
- }
58
+ _animate.remove (elements);
100
59
101
60
// Remove block from list
102
61
if (previous != null && (previous.next = next) != null ) {
0 commit comments