Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collectionView reset buffer itemView show condition #849

Merged
merged 1 commit into from
Jan 13, 2014

Conversation

samccone
Copy link
Member

When a collectionView was rendered and then reset, the itemView had
show called while it was still in the dom fragment.
Thus invalidating show and onDomRefresh

fixes #843

@samccone
Copy link
Member Author

ping @cobbweb for a review

});

it("collectionView should not be buffering on itemView show", function() {
cvInstance = new cv({collection: collection});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the norm with the tests is that any instances you create should be initialized in beforeEach.

beforeEach(function() {
  isBuffering = null;
  cvInstance = new cv({collection: collection});
  cvInstance.render().trigger('show');
});

@samccone
Copy link
Member Author

updated @cobbweb !

describe("when a collection is reset itemViews should not be shown until the buffering is over", function() {
var isBuffering, iv, cv, collection, cvInstance;

collection = new Backbone.Collection([{}]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, this guy should probably be moved into the beforeEach too. After that looks goods :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch 👍 all resolved

When a collectionView was rendered and then reset, the itemView had
show called while it was still in the dom fragment.
Thus invalidating show and onDomRefresh

fixes #843
cobbweb added a commit that referenced this pull request Jan 13, 2014
Fix collectionView reset buffer itemView show condition
@cobbweb cobbweb merged commit 81342a7 into master Jan 13, 2014
@samccone samccone deleted the sjs/843-collection-reset-bug branch January 13, 2014 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CollectionViews already shown in a Region will call onShow too early when the backing collection is reset
3 participants