Skip to content

Commit

Permalink
fix(kff.View): rollback refresh on requestAnimationFrame because mult…
Browse files Browse the repository at this point in the history
…iple data changes can lead to out-of-date keypaths in binders (esp. array indices when deleting items)
  • Loading branch information
karfcz committed Jan 2, 2015
1 parent 71a5777 commit b8540c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/kff.View.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ kff.View = kff.createClass(

this.delegateEvents();
this.delegateModelEvents();
if(this.dispatcher) this.dispatcher.on('refresh', this.f('requestRefreshAll'));
if(this.dispatcher) this.dispatcher.on('refresh', this.f('refreshAll'));

if(typeof this.afterRender === 'function') this.afterRender();

Expand Down Expand Up @@ -278,7 +278,7 @@ kff.View = kff.createClass(
this.undelegateEvents();
this.undelegateModelEvents();
this.destroySubviews();
if(this.dispatcher) this.dispatcher.off('refresh', this.f('requestRefreshAll'));
if(this.dispatcher) this.dispatcher.off('refresh', this.f('refreshAll'));

if(this.destroy !== kff.noop) ret = this.destroy();
if(typeof this.afterDestroy === 'function') this.afterDestroy();
Expand Down Expand Up @@ -1604,6 +1604,7 @@ kff.View = kff.createClass(
var view = this;
var collectionBinder;


while(view)
{
if(view.models.hasOwnProperty(modelName))
Expand Down

0 comments on commit b8540c2

Please sign in to comment.