@@ -77,11 +77,11 @@ Fragment.prototype.destroy = function () {
77
77
*/
78
78
79
79
function singleBefore ( target , withTransition ) {
80
+ this . inserted = true
80
81
var method = withTransition !== false
81
82
? transition . before
82
83
: _ . before
83
84
method ( this . node , target , this . vm )
84
- this . inserted = true
85
85
if ( _ . inDoc ( this . node ) ) {
86
86
this . callHook ( attach )
87
87
}
@@ -94,10 +94,10 @@ function singleBefore (target, withTransition) {
94
94
*/
95
95
96
96
function singleRemove ( destroy ) {
97
+ this . inserted = false
97
98
var shouldCallRemove = _ . inDoc ( this . node )
98
99
var self = this
99
100
transition . remove ( this . node , this . vm , function ( ) {
100
- self . inserted = false
101
101
if ( shouldCallRemove ) {
102
102
self . callHook ( detach )
103
103
}
@@ -111,13 +111,18 @@ function singleRemove (destroy) {
111
111
* Insert fragment before target, multi-nodes version
112
112
*
113
113
* @param {Node } target
114
+ * @param {Boolean } withTransition
114
115
*/
115
116
116
- function multiBefore ( target ) {
117
+ function multiBefore ( target , withTransition ) {
118
+ this . inserted = true
119
+ var vm = this . vm
120
+ var method = withTransition !== false
121
+ ? transition . before
122
+ : _ . before
117
123
_ . mapNodeRange ( this . node , this . end , function ( node ) {
118
- _ . before ( node , target )
124
+ method ( node , target , vm )
119
125
} )
120
- this . inserted = true
121
126
if ( _ . inDoc ( this . node ) ) {
122
127
this . callHook ( attach )
123
128
}
@@ -130,18 +135,17 @@ function multiBefore (target) {
130
135
*/
131
136
132
137
function multiRemove ( destroy ) {
133
- var frag = this . frag
138
+ this . inserted = false
139
+ var self = this
134
140
var shouldCallRemove = _ . inDoc ( this . node )
135
- _ . mapNodeRange ( this . node , this . end , function ( node ) {
136
- frag . appendChild ( node )
141
+ _ . removeNodeRange ( this . node , this . end , this . vm , this . frag , function ( ) {
142
+ if ( shouldCallRemove ) {
143
+ self . callHook ( detach )
144
+ }
145
+ if ( destroy ) {
146
+ self . destroy ( )
147
+ }
137
148
} )
138
- this . inserted = false
139
- if ( shouldCallRemove ) {
140
- this . callHook ( detach )
141
- }
142
- if ( destroy ) {
143
- this . destroy ( )
144
- }
145
149
}
146
150
147
151
/**
0 commit comments