|
@@ -7,6 +7,7 @@ var Emitter = require('./emitter'),
|
|
|
TextParser = require('./text-parser'),
|
|
TextParser = require('./text-parser'),
|
|
|
DepsParser = require('./deps-parser'),
|
|
DepsParser = require('./deps-parser'),
|
|
|
ExpParser = require('./exp-parser'),
|
|
ExpParser = require('./exp-parser'),
|
|
|
|
|
+ transition = require('./transition'),
|
|
|
|
|
|
|
|
// cache methods
|
|
// cache methods
|
|
|
slice = Array.prototype.slice,
|
|
slice = Array.prototype.slice,
|
|
@@ -22,6 +23,10 @@ function Compiler (vm, options) {
|
|
|
|
|
|
|
|
var compiler = this
|
|
var compiler = this
|
|
|
|
|
|
|
|
|
|
+ // indicate that we are intiating this instance
|
|
|
|
|
+ // so we should not run any transitions
|
|
|
|
|
+ compiler.init = true
|
|
|
|
|
+
|
|
|
// extend options
|
|
// extend options
|
|
|
options = compiler.options = options || makeHash()
|
|
options = compiler.options = options || makeHash()
|
|
|
utils.extend(compiler, options.compilerOptions)
|
|
utils.extend(compiler, options.compilerOptions)
|
|
@@ -112,6 +117,9 @@ function Compiler (vm, options) {
|
|
|
}
|
|
}
|
|
|
// extract dependencies for computed properties
|
|
// extract dependencies for computed properties
|
|
|
if (computed.length) DepsParser.parse(computed)
|
|
if (computed.length) DepsParser.parse(computed)
|
|
|
|
|
+
|
|
|
|
|
+ // done!
|
|
|
|
|
+ compiler.init = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var CompilerProto = Compiler.prototype
|
|
var CompilerProto = Compiler.prototype
|
|
@@ -618,7 +626,9 @@ CompilerProto.destroy = function () {
|
|
|
if (el === document.body) {
|
|
if (el === document.body) {
|
|
|
el.innerHTML = ''
|
|
el.innerHTML = ''
|
|
|
} else if (el.parentNode) {
|
|
} else if (el.parentNode) {
|
|
|
- el.parentNode.removeChild(el)
|
|
|
|
|
|
|
+ transition(el, -1, function () {
|
|
|
|
|
+ el.parentNode.removeChild(el)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|