{"action":"created","comment":{"url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/comments/92430455","pull_request_review_id":12945190,"id":92430455,"diff_hunk":"@@ -96,6 +103,33 @@ export class NgbPopover implements OnInit, OnDestroy {\n     });\n   }\n \n+  @HostListener('document:click', ['$event'])\n+  /**\n+   * Determines if a click occurs outside of the popover.\n+   */\n+  private _docClickListener(e) {\n+    if (this._triggered) {\n+      return this._triggered = false;\n+    }\n+\n+    if (!this._windowRef) {\n+      return;\n+    }\n+\n+    if (e.target !== this._windowRef.location.nativeElement &&\n+        !this._windowRef.location.nativeElement.contains(e.target)) {\n+      let ocEvent = document.createEvent('Event');\n+      if (ocEvent.initEvent) {\n+        /* For IE */\n+        ocEvent.initEvent('outsideClick', true, true);\n+      } else {\n+        /* Avoid deprecated API */\n+        ocEvent = new Event('outsideClick');\n+      }\n+      this._elementRef.nativeElement.dispatchEvent(ocEvent);","path":"src/popover/popover.ts","position":48,"original_position":48,"commit_id":"c4b6bcaffea06f9b03b87b30e22d10a77a335bc3","original_commit_id":"c4b6bcaffea06f9b03b87b30e22d10a77a335bc3","user":{"login":"spongessuck","id":6370382,"avatar_url":"https://avatars.githubusercontent.com/u/6370382?v=3","gravatar_id":"","url":"https://api.github.com/users/spongessuck","html_url":"https://github.com/spongessuck","followers_url":"https://api.github.com/users/spongessuck/followers","following_url":"https://api.github.com/users/spongessuck/following{/other_user}","gists_url":"https://api.github.com/users/spongessuck/gists{/gist_id}","starred_url":"https://api.github.com/users/spongessuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spongessuck/subscriptions","organizations_url":"https://api.github.com/users/spongessuck/orgs","repos_url":"https://api.github.com/users/spongessuck/repos","events_url":"https://api.github.com/users/spongessuck/events{/privacy}","received_events_url":"https://api.github.com/users/spongessuck/received_events","type":"User","site_admin":false},"body":"It's dispatching an event with the name 'clickOutside' so that the listeners already set up to check for events passed to the `triggers` attribute handle the close action.\r\n\r\nIf I were to call `close()` on the popover from here, I'd have to use the trigger parsing utility to check if the close trigger name is equal to 'clickOutside.' Since the listener logic is already doing this, I figured dispatching an event would be the more logical solution.","created_at":"2016-12-14T16:24:20Z","updated_at":"2016-12-14T16:24:21Z","html_url":"https://github.com/ng-bootstrap/ng-bootstrap/pull/1064#discussion_r92430455","pull_request_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/1064","_links":{"self":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/comments/92430455"},"html":{"href":"https://github.com/ng-bootstrap/ng-bootstrap/pull/1064#discussion_r92430455"},"pull_request":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/1064"}}},"pull_request":{"url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/1064","id":94471595,"html_url":"https://github.com/ng-bootstrap/ng-bootstrap/pull/1064","diff_url":"https://github.com/ng-bootstrap/ng-bootstrap/pull/1064.diff","patch_url":"https://github.com/ng-bootstrap/ng-bootstrap/pull/1064.patch","issue_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/1064","number":1064,"state":"open","locked":false,"title":"feat(popover): Support 'outsideClick' close trigger","user":{"login":"spongessuck","id":6370382,"avatar_url":"https://avatars.githubusercontent.com/u/6370382?v=3","gravatar_id":"","url":"https://api.github.com/users/spongessuck","html_url":"https://github.com/spongessuck","followers_url":"https://api.github.com/users/spongessuck/followers","following_url":"https://api.github.com/users/spongessuck/following{/other_user}","gists_url":"https://api.github.com/users/spongessuck/gists{/gist_id}","starred_url":"https://api.github.com/users/spongessuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spongessuck/subscriptions","organizations_url":"https://api.github.com/users/spongessuck/orgs","repos_url":"https://api.github.com/users/spongessuck/repos","events_url":"https://api.github.com/users/spongessuck/events{/privacy}","received_events_url":"https://api.github.com/users/spongessuck/received_events","type":"User","site_admin":false},"body":"Before submitting a pull request, please make sure you have at least performed the following:\r\n\r\n - [x] read and followed the [CONTRIBUTING.md](https://github.com/ng-bootstrap/ng-bootstrap/blob/master/CONTRIBUTING.md) guide.\r\n - [x] built and tested the changes locally.\r\n - [x] added/updated any applicable tests.\r\n - [x] added/updated any applicable API documentation.\r\n - [x] added/updated any applicable demos.\r\n\r\nAdd support for a special `outsideClick` close trigger to close popovers when a click occurs outside of it. Closes #933.","created_at":"2016-11-19T05:28:21Z","updated_at":"2016-12-14T16:24:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea911176d84385e10e8ace57a47987339bd84518","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/1064/commits","review_comments_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/1064/comments","review_comment_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/1064/comments","statuses_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/statuses/c4b6bcaffea06f9b03b87b30e22d10a77a335bc3","head":{"label":"spongessuck:master","ref":"master","sha":"c4b6bcaffea06f9b03b87b30e22d10a77a335bc3","user":{"login":"spongessuck","id":6370382,"avatar_url":"https://avatars.githubusercontent.com/u/6370382?v=3","gravatar_id":"","url":"https://api.github.com/users/spongessuck","html_url":"https://github.com/spongessuck","followers_url":"https://api.github.com/users/spongessuck/followers","following_url":"https://api.github.com/users/spongessuck/following{/other_user}","gists_url":"https://api.github.com/users/spongessuck/gists{/gist_id}","starred_url":"https://api.github.com/users/spongessuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spongessuck/subscriptions","organizations_url":"https://api.github.com/users/spongessuck/orgs","repos_url":"https://api.github.com/users/spongessuck/repos","events_url":"https://api.github.com/users/spongessuck/events{/privacy}","received_events_url":"https://api.github.com/users/spongessuck/received_events","type":"User","site_admin":false},"repo":{"id":74182276,"name":"ng-bootstrap","full_name":"spongessuck/ng-bootstrap","owner":{"login":"spongessuck","id":6370382,"avatar_url":"https://avatars.githubusercontent.com/u/6370382?v=3","gravatar_id":"","url":"https://api.github.com/users/spongessuck","html_url":"https://github.com/spongessuck","followers_url":"https://api.github.com/users/spongessuck/followers","following_url":"https://api.github.com/users/spongessuck/following{/other_user}","gists_url":"https://api.github.com/users/spongessuck/gists{/gist_id}","starred_url":"https://api.github.com/users/spongessuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spongessuck/subscriptions","organizations_url":"https://api.github.com/users/spongessuck/orgs","repos_url":"https://api.github.com/users/spongessuck/repos","events_url":"https://api.github.com/users/spongessuck/events{/privacy}","received_events_url":"https://api.github.com/users/spongessuck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spongessuck/ng-bootstrap","description":"Angular 2 powered Bootstrap","fork":true,"url":"https://api.github.com/repos/spongessuck/ng-bootstrap","forks_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/forks","keys_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/teams","hooks_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/events","assignees_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/tags","blobs_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/languages","stargazers_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/subscription","commits_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/merges","archive_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/downloads","issues_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/spongessuck/ng-bootstrap/deployments","created_at":"2016-11-19T02:35:14Z","updated_at":"2016-11-19T02:35:15Z","pushed_at":"2016-12-05T20:15:09Z","git_url":"git://github.com/spongessuck/ng-bootstrap.git","ssh_url":"git@github.com:spongessuck/ng-bootstrap.git","clone_url":"https://github.com/spongessuck/ng-bootstrap.git","svn_url":"https://github.com/spongessuck/ng-bootstrap","homepage":"https://ng-bootstrap.github.io","size":1225,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"ng-bootstrap:master","ref":"master","sha":"6b8827ad471a8f7438be9fa5cb4670c092e2f280","user":{"login":"ng-bootstrap","id":14283866,"avatar_url":"https://avatars.githubusercontent.com/u/14283866?v=3","gravatar_id":"","url":"https://api.github.com/users/ng-bootstrap","html_url":"https://github.com/ng-bootstrap","followers_url":"https://api.github.com/users/ng-bootstrap/followers","following_url":"https://api.github.com/users/ng-bootstrap/following{/other_user}","gists_url":"https://api.github.com/users/ng-bootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/ng-bootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ng-bootstrap/subscriptions","organizations_url":"https://api.github.com/users/ng-bootstrap/orgs","repos_url":"https://api.github.com/users/ng-bootstrap/repos","events_url":"https://api.github.com/users/ng-bootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/ng-bootstrap/received_events","type":"Organization","site_admin":false},"repo":{"id":42481664,"name":"ng-bootstrap","full_name":"ng-bootstrap/ng-bootstrap","owner":{"login":"ng-bootstrap","id":14283866,"avatar_url":"https://avatars.githubusercontent.com/u/14283866?v=3","gravatar_id":"","url":"https://api.github.com/users/ng-bootstrap","html_url":"https://github.com/ng-bootstrap","followers_url":"https://api.github.com/users/ng-bootstrap/followers","following_url":"https://api.github.com/users/ng-bootstrap/following{/other_user}","gists_url":"https://api.github.com/users/ng-bootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/ng-bootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ng-bootstrap/subscriptions","organizations_url":"https://api.github.com/users/ng-bootstrap/orgs","repos_url":"https://api.github.com/users/ng-bootstrap/repos","events_url":"https://api.github.com/users/ng-bootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/ng-bootstrap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ng-bootstrap/ng-bootstrap","description":"Angular 2 powered Bootstrap","fork":false,"url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap","forks_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/forks","keys_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/teams","hooks_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/events","assignees_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/tags","blobs_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/languages","stargazers_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/subscription","commits_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/merges","archive_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/downloads","issues_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/deployments","created_at":"2015-09-14T22:55:53Z","updated_at":"2016-12-14T14:24:19Z","pushed_at":"2016-12-14T16:22:50Z","git_url":"git://github.com/ng-bootstrap/ng-bootstrap.git","ssh_url":"git@github.com:ng-bootstrap/ng-bootstrap.git","clone_url":"https://github.com/ng-bootstrap/ng-bootstrap.git","svn_url":"https://github.com/ng-bootstrap/ng-bootstrap","homepage":"https://ng-bootstrap.github.io","size":1254,"stargazers_count":1753,"watchers_count":1753,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":272,"mirror_url":null,"open_issues_count":81,"forks":272,"open_issues":81,"watchers":1753,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/1064"},"html":{"href":"https://github.com/ng-bootstrap/ng-bootstrap/pull/1064"},"issue":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/1064"},"comments":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/1064/comments"},"review_comments":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/1064/comments"},"review_comment":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/1064/commits"},"statuses":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/statuses/c4b6bcaffea06f9b03b87b30e22d10a77a335bc3"}}}}
{"actor":{"display_login":"spongessuck"}}