{"action":"created","comment":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/33596329","id":33596329,"diff_hunk":"@@ -101,7 +101,7 @@ Marionette.CollectionView = Marionette.View.extend({\n   _onCollectionAdd: function(child, collection, opts) {\n     var index;\n     if (opts.at !== undefined) {\n-      index = opts.at;\n+      index = opts.index !== undefined ? opts.index : collection.indexOf(child);","path":"src/collection-view.js","position":5,"original_position":5,"commit_id":"821b9387edb40e4e7a5b3f1273f8138b4dde159e","original_commit_id":"f23a33e8d17d079a8dd02843d729f9000ff57d1f","user":{"login":"cybernetlab","id":1825009,"avatar_url":"https://avatars.githubusercontent.com/u/1825009?v=3","gravatar_id":"","url":"https://api.github.com/users/cybernetlab","html_url":"https://github.com/cybernetlab","followers_url":"https://api.github.com/users/cybernetlab/followers","following_url":"https://api.github.com/users/cybernetlab/following{/other_user}","gists_url":"https://api.github.com/users/cybernetlab/gists{/gist_id}","starred_url":"https://api.github.com/users/cybernetlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybernetlab/subscriptions","organizations_url":"https://api.github.com/users/cybernetlab/orgs","repos_url":"https://api.github.com/users/cybernetlab/repos","events_url":"https://api.github.com/users/cybernetlab/events{/privacy}","received_events_url":"https://api.github.com/users/cybernetlab/received_events","type":"User","site_admin":false},"body":"Strange, but spec for filtered collection passed with my current code.. May be I'm wrong in spec?","created_at":"2015-06-30T17:00:04Z","updated_at":"2015-06-30T17:00:04Z","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2635#discussion_r33596329","pull_request_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2635","_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/33596329"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/2635#discussion_r33596329"},"pull_request":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2635"}}},"pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2635","id":38715643,"html_url":"https://github.com/marionettejs/backbone.marionette/pull/2635","diff_url":"https://github.com/marionettejs/backbone.marionette/pull/2635.diff","patch_url":"https://github.com/marionettejs/backbone.marionette/pull/2635.patch","issue_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2635","number":2635,"state":"open","locked":false,"title":"fixes #2578","user":{"login":"cybernetlab","id":1825009,"avatar_url":"https://avatars.githubusercontent.com/u/1825009?v=3","gravatar_id":"","url":"https://api.github.com/users/cybernetlab","html_url":"https://github.com/cybernetlab","followers_url":"https://api.github.com/users/cybernetlab/followers","following_url":"https://api.github.com/users/cybernetlab/following{/other_user}","gists_url":"https://api.github.com/users/cybernetlab/gists{/gist_id}","starred_url":"https://api.github.com/users/cybernetlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybernetlab/subscriptions","organizations_url":"https://api.github.com/users/cybernetlab/orgs","repos_url":"https://api.github.com/users/cybernetlab/repos","events_url":"https://api.github.com/users/cybernetlab/events{/privacy}","received_events_url":"https://api.github.com/users/cybernetlab/received_events","type":"User","site_admin":false},"body":"actually, when `Backbone.Collection#add ` method called with a bunch of models, backbone triggers `add` event sequentially for each model, so where are no way to determine inside the `_onCollectionAdd` event handler whether one or many models are added. But backbone triggers `update` event after a number of `add` events, once per `Backbone.Collection#add` call. So I decide to add a \"private\" `_atIndex` flag to indicate this situation. I've add `_onCollectionUpdate` handler to reset this flag after one or more models have been added.","created_at":"2015-06-27T21:09:55Z","updated_at":"2015-06-30T17:00:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ff87e62898b60679d9ba2370e9ef83386802d25","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2635/commits","review_comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2635/comments","review_comment_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2635/comments","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/821b9387edb40e4e7a5b3f1273f8138b4dde159e","head":{"label":"cybernetlab:patch","ref":"patch","sha":"821b9387edb40e4e7a5b3f1273f8138b4dde159e","user":{"login":"cybernetlab","id":1825009,"avatar_url":"https://avatars.githubusercontent.com/u/1825009?v=3","gravatar_id":"","url":"https://api.github.com/users/cybernetlab","html_url":"https://github.com/cybernetlab","followers_url":"https://api.github.com/users/cybernetlab/followers","following_url":"https://api.github.com/users/cybernetlab/following{/other_user}","gists_url":"https://api.github.com/users/cybernetlab/gists{/gist_id}","starred_url":"https://api.github.com/users/cybernetlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybernetlab/subscriptions","organizations_url":"https://api.github.com/users/cybernetlab/orgs","repos_url":"https://api.github.com/users/cybernetlab/repos","events_url":"https://api.github.com/users/cybernetlab/events{/privacy}","received_events_url":"https://api.github.com/users/cybernetlab/received_events","type":"User","site_admin":false},"repo":{"id":38171854,"name":"backbone.marionette","full_name":"cybernetlab/backbone.marionette","owner":{"login":"cybernetlab","id":1825009,"avatar_url":"https://avatars.githubusercontent.com/u/1825009?v=3","gravatar_id":"","url":"https://api.github.com/users/cybernetlab","html_url":"https://github.com/cybernetlab","followers_url":"https://api.github.com/users/cybernetlab/followers","following_url":"https://api.github.com/users/cybernetlab/following{/other_user}","gists_url":"https://api.github.com/users/cybernetlab/gists{/gist_id}","starred_url":"https://api.github.com/users/cybernetlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybernetlab/subscriptions","organizations_url":"https://api.github.com/users/cybernetlab/orgs","repos_url":"https://api.github.com/users/cybernetlab/repos","events_url":"https://api.github.com/users/cybernetlab/events{/privacy}","received_events_url":"https://api.github.com/users/cybernetlab/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cybernetlab/backbone.marionette","description":"The Backbone Framework","fork":true,"url":"https://api.github.com/repos/cybernetlab/backbone.marionette","forks_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/forks","keys_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/events","assignees_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/issues/comments{/number}","contents_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/merges","archive_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/cybernetlab/backbone.marionette/releases{/id}","created_at":"2015-06-27T19:07:20Z","updated_at":"2015-06-27T19:07:22Z","pushed_at":"2015-06-30T16:17:20Z","git_url":"git://github.com/cybernetlab/backbone.marionette.git","ssh_url":"git@github.com:cybernetlab/backbone.marionette.git","clone_url":"https://github.com/cybernetlab/backbone.marionette.git","svn_url":"https://github.com/cybernetlab/backbone.marionette","homepage":"http://marionettejs.com","size":10671,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"marionettejs:patch","ref":"patch","sha":"815b555794115d39c29576a0b58943d1335aec2c","user":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"repo":{"id":2965621,"name":"backbone.marionette","full_name":"marionettejs/backbone.marionette","owner":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marionettejs/backbone.marionette","description":"The Backbone Framework","fork":false,"url":"https://api.github.com/repos/marionettejs/backbone.marionette","forks_url":"https://api.github.com/repos/marionettejs/backbone.marionette/forks","keys_url":"https://api.github.com/repos/marionettejs/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marionettejs/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marionettejs/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/marionettejs/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/events","assignees_url":"https://api.github.com/repos/marionettejs/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/marionettejs/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/marionettejs/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/marionettejs/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/marionettejs/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/marionettejs/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/marionettejs/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/marionettejs/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/comments{/number}","contents_url":"https://api.github.com/repos/marionettejs/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/marionettejs/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marionettejs/backbone.marionette/merges","archive_url":"https://api.github.com/repos/marionettejs/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marionettejs/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/marionettejs/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/marionettejs/backbone.marionette/releases{/id}","created_at":"2011-12-12T16:36:09Z","updated_at":"2015-06-30T15:12:45Z","pushed_at":"2015-06-30T16:49:12Z","git_url":"git://github.com/marionettejs/backbone.marionette.git","ssh_url":"git@github.com:marionettejs/backbone.marionette.git","clone_url":"https://github.com/marionettejs/backbone.marionette.git","svn_url":"https://github.com/marionettejs/backbone.marionette","homepage":"http://marionettejs.com","size":22984,"stargazers_count":6281,"watchers_count":6281,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1235,"mirror_url":null,"open_issues_count":125,"forks":1235,"open_issues":125,"watchers":6281,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2635"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/2635"},"issue":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2635"},"comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2635/comments"},"review_comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2635/comments"},"review_comment":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2635/commits"},"statuses":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/821b9387edb40e4e7a5b3f1273f8138b4dde159e"}}}}