Skip to content

Commit

Permalink
Merge pull request #1100 from rockyzh/master
Browse files Browse the repository at this point in the history
#1099 修改对二维数组项repeat时,变换下标不能触发视图更新,及更新前后数组长度一样时不能更新的bug
  • Loading branch information
RubyLouvre committed Oct 13, 2015
2 parents 6f33051 + eb987bb commit fef2d1d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/19 directive/repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ bindingHandlers.repeat = function (data, vmodels) {
}
}

data.handler = noop
avalon.injectBinding(data)

var elem = data.element
if (elem.nodeType === 1) {
elem.removeAttribute(data.name)
Expand Down Expand Up @@ -97,7 +100,12 @@ bindingExecutors.repeat = function (method, pos, el) {

if (data.xtype === "array") {
if (old.length === neo.length) {
return
if (old != neo && old.length > 0) {
arguments.callee.call(this, 'clear', pos, el)
}
else {
return
}
}
method = "add"
pos = 0
Expand Down

0 comments on commit fef2d1d

Please sign in to comment.