{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/grid/pulls/comments/37212788","id":37212788,"diff_hunk":"@@ -370,6 +370,23 @@ results.controller('SearchResultsCtrl', [\n             }\n         });\n \n+        const freeImageDeleteListener = $rootScope.$on('image-deleted', (e, image) => {\n+            selection.remove(image);\n+\n+            const imageIndex = ctrl.images.findIndex(i => image.data.id === i.data.id);\n+            const imageAllIndex = ctrl.imagesAll.findIndex(i => image.data.id === i.data.id);\n+\n+            if (imageIndex > -1) {\n+                ctrl.images.splice(imageIndex, 1);\n+            }\n+\n+            if (imageAllIndex > -1) {\n+                ctrl.imagesAll.splice(imageIndex, 1);\n+            }\n+\n+            ctrl.totalResults += -1;","path":"kahuna/public/js/search/results.js","position":18,"original_position":18,"commit_id":"115bf59e497b6551b1f1e0508e00917304d825bd","original_commit_id":"115bf59e497b6551b1f1e0508e00917304d825bd","user":{"login":"theefer","id":36964,"avatar_url":"https://avatars.githubusercontent.com/u/36964?v=3","gravatar_id":"","url":"https://api.github.com/users/theefer","html_url":"https://github.com/theefer","followers_url":"https://api.github.com/users/theefer/followers","following_url":"https://api.github.com/users/theefer/following{/other_user}","gists_url":"https://api.github.com/users/theefer/gists{/gist_id}","starred_url":"https://api.github.com/users/theefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theefer/subscriptions","organizations_url":"https://api.github.com/users/theefer/orgs","repos_url":"https://api.github.com/users/theefer/repos","events_url":"https://api.github.com/users/theefer/events{/privacy}","received_events_url":"https://api.github.com/users/theefer/received_events","type":"User","site_admin":false},"body":"did you mean `ctrl.totalResults -= 1` or even `ctrl.totalResults--`? :-)","created_at":"2015-08-17T17:28:17Z","updated_at":"2015-08-17T17:28:17Z","html_url":"https://github.com/guardian/grid/pull/1101#discussion_r37212788","pull_request_url":"https://api.github.com/repos/guardian/grid/pulls/1101","_links":{"self":{"href":"https://api.github.com/repos/guardian/grid/pulls/comments/37212788"},"html":{"href":"https://github.com/guardian/grid/pull/1101#discussion_r37212788"},"pull_request":{"href":"https://api.github.com/repos/guardian/grid/pulls/1101"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/grid/pulls/1101","id":42608655,"html_url":"https://github.com/guardian/grid/pull/1101","diff_url":"https://github.com/guardian/grid/pull/1101.diff","patch_url":"https://github.com/guardian/grid/pull/1101.patch","issue_url":"https://api.github.com/repos/guardian/grid/issues/1101","number":1101,"state":"open","locked":false,"title":"Batch delete images.","user":{"login":"akash1810","id":836140,"avatar_url":"https://avatars.githubusercontent.com/u/836140?v=3","gravatar_id":"","url":"https://api.github.com/users/akash1810","html_url":"https://github.com/akash1810","followers_url":"https://api.github.com/users/akash1810/followers","following_url":"https://api.github.com/users/akash1810/following{/other_user}","gists_url":"https://api.github.com/users/akash1810/gists{/gist_id}","starred_url":"https://api.github.com/users/akash1810/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akash1810/subscriptions","organizations_url":"https://api.github.com/users/akash1810/orgs","repos_url":"https://api.github.com/users/akash1810/repos","events_url":"https://api.github.com/users/akash1810/events{/privacy}","received_events_url":"https://api.github.com/users/akash1810/received_events","type":"User","site_admin":false},"body":"Haven't spent too long on styling as this'll move to the toolbar soon (hopefully!).\r\n\r\n<img width=\"292\" alt=\"screen shot 2015-08-17 at 17 41 51\" src=\"https://cloud.githubusercontent.com/assets/836140/9310376/4b3a88be-4507-11e5-8c0a-c88f2d217f97.png\">\r\n","created_at":"2015-08-17T16:43:47Z","updated_at":"2015-08-17T17:28:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f8f763b394e275f2466c5712cbf39d185bc2548","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guardian/grid/pulls/1101/commits","review_comments_url":"https://api.github.com/repos/guardian/grid/pulls/1101/comments","review_comment_url":"https://api.github.com/repos/guardian/grid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/grid/issues/1101/comments","statuses_url":"https://api.github.com/repos/guardian/grid/statuses/115bf59e497b6551b1f1e0508e00917304d825bd","head":{"label":"guardian:aa-batch-delete","ref":"aa-batch-delete","sha":"115bf59e497b6551b1f1e0508e00917304d825bd","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":12298112,"name":"grid","full_name":"guardian/grid","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/grid","description":"The Guardian’s new image management system","fork":false,"url":"https://api.github.com/repos/guardian/grid","forks_url":"https://api.github.com/repos/guardian/grid/forks","keys_url":"https://api.github.com/repos/guardian/grid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/grid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/grid/teams","hooks_url":"https://api.github.com/repos/guardian/grid/hooks","issue_events_url":"https://api.github.com/repos/guardian/grid/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/grid/events","assignees_url":"https://api.github.com/repos/guardian/grid/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/grid/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/grid/tags","blobs_url":"https://api.github.com/repos/guardian/grid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/grid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/grid/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/grid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/grid/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/grid/languages","stargazers_url":"https://api.github.com/repos/guardian/grid/stargazers","contributors_url":"https://api.github.com/repos/guardian/grid/contributors","subscribers_url":"https://api.github.com/repos/guardian/grid/subscribers","subscription_url":"https://api.github.com/repos/guardian/grid/subscription","commits_url":"https://api.github.com/repos/guardian/grid/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/grid/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/grid/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/grid/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/grid/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/grid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/grid/merges","archive_url":"https://api.github.com/repos/guardian/grid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/grid/downloads","issues_url":"https://api.github.com/repos/guardian/grid/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/grid/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/grid/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/grid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/grid/labels{/name}","releases_url":"https://api.github.com/repos/guardian/grid/releases{/id}","created_at":"2013-08-22T13:49:31Z","updated_at":"2015-08-17T16:43:46Z","pushed_at":"2015-08-17T16:43:48Z","git_url":"git://github.com/guardian/grid.git","ssh_url":"git@github.com:guardian/grid.git","clone_url":"https://github.com/guardian/grid.git","svn_url":"https://github.com/guardian/grid","homepage":"","size":27557,"stargazers_count":751,"watchers_count":751,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":68,"forks":24,"open_issues":68,"watchers":751,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"c40a4cc115c4a5be3d9bcc86ea263aac53caa796","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":12298112,"name":"grid","full_name":"guardian/grid","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/grid","description":"The Guardian’s new image management system","fork":false,"url":"https://api.github.com/repos/guardian/grid","forks_url":"https://api.github.com/repos/guardian/grid/forks","keys_url":"https://api.github.com/repos/guardian/grid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/grid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/grid/teams","hooks_url":"https://api.github.com/repos/guardian/grid/hooks","issue_events_url":"https://api.github.com/repos/guardian/grid/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/grid/events","assignees_url":"https://api.github.com/repos/guardian/grid/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/grid/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/grid/tags","blobs_url":"https://api.github.com/repos/guardian/grid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/grid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/grid/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/grid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/grid/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/grid/languages","stargazers_url":"https://api.github.com/repos/guardian/grid/stargazers","contributors_url":"https://api.github.com/repos/guardian/grid/contributors","subscribers_url":"https://api.github.com/repos/guardian/grid/subscribers","subscription_url":"https://api.github.com/repos/guardian/grid/subscription","commits_url":"https://api.github.com/repos/guardian/grid/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/grid/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/grid/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/grid/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/grid/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/grid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/grid/merges","archive_url":"https://api.github.com/repos/guardian/grid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/grid/downloads","issues_url":"https://api.github.com/repos/guardian/grid/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/grid/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/grid/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/grid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/grid/labels{/name}","releases_url":"https://api.github.com/repos/guardian/grid/releases{/id}","created_at":"2013-08-22T13:49:31Z","updated_at":"2015-08-17T16:43:46Z","pushed_at":"2015-08-17T16:43:48Z","git_url":"git://github.com/guardian/grid.git","ssh_url":"git@github.com:guardian/grid.git","clone_url":"https://github.com/guardian/grid.git","svn_url":"https://github.com/guardian/grid","homepage":"","size":27557,"stargazers_count":751,"watchers_count":751,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":68,"forks":24,"open_issues":68,"watchers":751,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/grid/pulls/1101"},"html":{"href":"https://github.com/guardian/grid/pull/1101"},"issue":{"href":"https://api.github.com/repos/guardian/grid/issues/1101"},"comments":{"href":"https://api.github.com/repos/guardian/grid/issues/1101/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/grid/pulls/1101/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/grid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/grid/pulls/1101/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/grid/statuses/115bf59e497b6551b1f1e0508e00917304d825bd"}}}}