Skip to content

Commit

Permalink
Merge pull request RubyLouvre#482 from ilife5/master
Browse files Browse the repository at this point in the history
升级notifySubscribers,增加删除冗余回调函数的逻辑
  • Loading branch information
RubyLouvre committed Sep 10, 2014
2 parents ac4d267 + 1e834c0 commit e21810f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions avalon.js
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,8 @@
remove = true
}
}
} else if(fn.type === "if") {
remove = true
}
if (remove) { //如果它没有在DOM树
list.splice(i, 1)
Expand Down
4 changes: 3 additions & 1 deletion avalon.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@
var inTree = root.contains(el)
var remove = !ifSanctuary.contains(el) && !inTree
var comment = fn.placehoder
if (fn.type === "if" && comment) {
if (fn.type === "if") {
var recycle = fn.msInDocument ? !inTree : !avalon.contains(root, comment)
if (recycle) {
if (!fn.msInDocument && comment.elem) {
Expand All @@ -1342,6 +1342,8 @@
remove = true
}
}
} else if(fn.type === "if") {
remove = true
}
if (remove) {
list.splice(i, 1)
Expand Down

0 comments on commit e21810f

Please sign in to comment.