{"action":"created","comment":{"url":"https://api.github.com/repos/angular/material/pulls/comments/78687917","id":78687917,"diff_hunk":"@@ -1636,6 +1697,106 @@ MdPanelRef.prototype._animateClose = function() {\n   });\n };\n \n+/**\n+ * Registers a interceptor with the panel. The callback should return a promise,\n+ * which will allow the action to continue when it gets resolved, or will\n+ * prevent an action if it is rejected.\n+ * @param {string} type Type of interceptor.\n+ * @param {!angular.$q.Promise<!any>} callback Callback to be registered.\n+ * @returns {!MdPanelRef}\n+ */\n+MdPanelRef.prototype.registerInterceptor = function(type, callback) {\n+  var error = null;\n+\n+  if (!angular.isString(type)) {\n+    error = 'Interceptor type must be a string, instead got ' + typeof type;\n+  } else if (!angular.isFunction(callback)) {\n+    error = 'Interceptor callback must be a function, instead got ' + typeof callback;\n+  }\n+\n+  if (error) {\n+    throw new Error('MdPanel: ' + error);\n+  }\n+\n+  var interceptors = this._interceptors[type] = this._interceptors[type] || [];\n+\n+  if (interceptors.indexOf(callback) === -1) {\n+    interceptors.push(callback);\n+  }\n+\n+  return this;\n+};\n+\n+/**\n+ * Removes a registered interceptor.\n+ * @param {string} type Type of interceptor to be removed.\n+ * @param {Function} callback Interceptor to be removed.\n+ * @returns {!MdPanelRef}\n+ */\n+MdPanelRef.prototype.removeInterceptor = function(type, callback) {\n+  var index = this._interceptors[type] ?\n+    this._interceptors[type].indexOf(callback) : -1;\n+\n+  if (index > -1) {\n+    this._interceptors[type].splice(index, 1);\n+  }\n+\n+  return this;\n+};\n+\n+\n+/**\n+ * Removes all interceptors.\n+ * @param {string=} type Type of interceptors to be removed.\n+ *     If ommited, all interceptors types will be removed.\n+ * @returns {!MdPanelRef}\n+ */\n+MdPanelRef.prototype.removeAllInterceptors = function(type) {\n+  if (type) {\n+    this._interceptors[type] = [];\n+  } else {\n+    this._interceptors = Object.create(null);\n+  }\n+\n+  return this;\n+};\n+\n+\n+/**\n+ * Invokes all the interceptors of a certain type sequantially in\n+ *     reverse order. Works in a similar way to `$q.all`, except it\n+ *     respects the order of the functions.\n+ * @param {string} type Type of interceptors to be invoked.\n+ * @returns {!angular.$q.Promise<!MdPanelRef>}\n+ * @private\n+ */\n+MdPanelRef.prototype._callInterceptors = function(type) {","path":"src/components/panel/panel.js","position":190,"original_position":190,"commit_id":"760f3169599961fbcf87cc15b3b5c99df7e6f2b8","original_commit_id":"760f3169599961fbcf87cc15b3b5c99df7e6f2b8","user":{"login":"crisbeto","id":4450522,"avatar_url":"https://avatars.githubusercontent.com/u/4450522?v=3","gravatar_id":"","url":"https://api.github.com/users/crisbeto","html_url":"https://github.com/crisbeto","followers_url":"https://api.github.com/users/crisbeto/followers","following_url":"https://api.github.com/users/crisbeto/following{/other_user}","gists_url":"https://api.github.com/users/crisbeto/gists{/gist_id}","starred_url":"https://api.github.com/users/crisbeto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisbeto/subscriptions","organizations_url":"https://api.github.com/users/crisbeto/orgs","repos_url":"https://api.github.com/users/crisbeto/repos","events_url":"https://api.github.com/users/crisbeto/events{/privacy}","received_events_url":"https://api.github.com/users/crisbeto/received_events","type":"User","site_admin":false},"body":"Alright, my bad, that works pretty well. At first glance last night it seemed like it would only chain the callbacks (`.then`), but not promises themselves (if that makes sense).","created_at":"2016-09-14T05:27:42Z","updated_at":"2016-09-14T05:27:42Z","html_url":"https://github.com/angular/material/pull/9574#discussion_r78687917","pull_request_url":"https://api.github.com/repos/angular/material/pulls/9574","_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/comments/78687917"},"html":{"href":"https://github.com/angular/material/pull/9574#discussion_r78687917"},"pull_request":{"href":"https://api.github.com/repos/angular/material/pulls/9574"}}},"pull_request":{"url":"https://api.github.com/repos/angular/material/pulls/9574","id":84785880,"html_url":"https://github.com/angular/material/pull/9574","diff_url":"https://github.com/angular/material/pull/9574.diff","patch_url":"https://github.com/angular/material/pull/9574.patch","issue_url":"https://api.github.com/repos/angular/material/issues/9574","number":9574,"state":"open","locked":false,"title":"feat(panel): add interceptors API and onClose hook","user":{"login":"crisbeto","id":4450522,"avatar_url":"https://avatars.githubusercontent.com/u/4450522?v=3","gravatar_id":"","url":"https://api.github.com/users/crisbeto","html_url":"https://github.com/crisbeto","followers_url":"https://api.github.com/users/crisbeto/followers","following_url":"https://api.github.com/users/crisbeto/following{/other_user}","gists_url":"https://api.github.com/users/crisbeto/gists{/gist_id}","starred_url":"https://api.github.com/users/crisbeto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisbeto/subscriptions","organizations_url":"https://api.github.com/users/crisbeto/orgs","repos_url":"https://api.github.com/users/crisbeto/repos","events_url":"https://api.github.com/users/crisbeto/events{/privacy}","received_events_url":"https://api.github.com/users/crisbeto/received_events","type":"User","site_admin":false},"body":"* Adds an API that can be used for registering interceptors on the panel.\r\n* Adds support for an `onClose` interceptor that allows the user to prevent a panel from closing.\r\n\r\nFixes #9557.","created_at":"2016-09-11T13:03:37Z","updated_at":"2016-09-14T05:27:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a610254274ee5a8089ec226045897c87b6fc6eee","assignee":{"login":"ThomasBurleson","id":210413,"avatar_url":"https://avatars.githubusercontent.com/u/210413?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBurleson","html_url":"https://github.com/ThomasBurleson","followers_url":"https://api.github.com/users/ThomasBurleson/followers","following_url":"https://api.github.com/users/ThomasBurleson/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBurleson/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBurleson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBurleson/subscriptions","organizations_url":"https://api.github.com/users/ThomasBurleson/orgs","repos_url":"https://api.github.com/users/ThomasBurleson/repos","events_url":"https://api.github.com/users/ThomasBurleson/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBurleson/received_events","type":"User","site_admin":false},"assignees":[{"login":"ThomasBurleson","id":210413,"avatar_url":"https://avatars.githubusercontent.com/u/210413?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBurleson","html_url":"https://github.com/ThomasBurleson","followers_url":"https://api.github.com/users/ThomasBurleson/followers","following_url":"https://api.github.com/users/ThomasBurleson/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBurleson/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBurleson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBurleson/subscriptions","organizations_url":"https://api.github.com/users/ThomasBurleson/orgs","repos_url":"https://api.github.com/users/ThomasBurleson/repos","events_url":"https://api.github.com/users/ThomasBurleson/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBurleson/received_events","type":"User","site_admin":false},{"login":"ErinCoughlan","id":2660421,"avatar_url":"https://avatars.githubusercontent.com/u/2660421?v=3","gravatar_id":"","url":"https://api.github.com/users/ErinCoughlan","html_url":"https://github.com/ErinCoughlan","followers_url":"https://api.github.com/users/ErinCoughlan/followers","following_url":"https://api.github.com/users/ErinCoughlan/following{/other_user}","gists_url":"https://api.github.com/users/ErinCoughlan/gists{/gist_id}","starred_url":"https://api.github.com/users/ErinCoughlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErinCoughlan/subscriptions","organizations_url":"https://api.github.com/users/ErinCoughlan/orgs","repos_url":"https://api.github.com/users/ErinCoughlan/repos","events_url":"https://api.github.com/users/ErinCoughlan/events{/privacy}","received_events_url":"https://api.github.com/users/ErinCoughlan/received_events","type":"User","site_admin":false},{"login":"bradrich","id":3429878,"avatar_url":"https://avatars.githubusercontent.com/u/3429878?v=3","gravatar_id":"","url":"https://api.github.com/users/bradrich","html_url":"https://github.com/bradrich","followers_url":"https://api.github.com/users/bradrich/followers","following_url":"https://api.github.com/users/bradrich/following{/other_user}","gists_url":"https://api.github.com/users/bradrich/gists{/gist_id}","starred_url":"https://api.github.com/users/bradrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradrich/subscriptions","organizations_url":"https://api.github.com/users/bradrich/orgs","repos_url":"https://api.github.com/users/bradrich/repos","events_url":"https://api.github.com/users/bradrich/events{/privacy}","received_events_url":"https://api.github.com/users/bradrich/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/angular/material/milestones/36","html_url":"https://github.com/angular/material/milestones/1.1.2","labels_url":"https://api.github.com/repos/angular/material/milestones/36/labels","id":1485958,"number":36,"title":"1.1.2","description":"","creator":{"login":"ThomasBurleson","id":210413,"avatar_url":"https://avatars.githubusercontent.com/u/210413?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBurleson","html_url":"https://github.com/ThomasBurleson","followers_url":"https://api.github.com/users/ThomasBurleson/followers","following_url":"https://api.github.com/users/ThomasBurleson/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBurleson/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBurleson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBurleson/subscriptions","organizations_url":"https://api.github.com/users/ThomasBurleson/orgs","repos_url":"https://api.github.com/users/ThomasBurleson/repos","events_url":"https://api.github.com/users/ThomasBurleson/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBurleson/received_events","type":"User","site_admin":false},"open_issues":56,"closed_issues":30,"state":"open","created_at":"2016-01-05T21:40:38Z","updated_at":"2016-09-13T16:52:17Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/angular/material/pulls/9574/commits","review_comments_url":"https://api.github.com/repos/angular/material/pulls/9574/comments","review_comment_url":"https://api.github.com/repos/angular/material/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/material/issues/9574/comments","statuses_url":"https://api.github.com/repos/angular/material/statuses/760f3169599961fbcf87cc15b3b5c99df7e6f2b8","head":{"label":"crisbeto:9557/panel-listeners","ref":"9557/panel-listeners","sha":"760f3169599961fbcf87cc15b3b5c99df7e6f2b8","user":{"login":"crisbeto","id":4450522,"avatar_url":"https://avatars.githubusercontent.com/u/4450522?v=3","gravatar_id":"","url":"https://api.github.com/users/crisbeto","html_url":"https://github.com/crisbeto","followers_url":"https://api.github.com/users/crisbeto/followers","following_url":"https://api.github.com/users/crisbeto/following{/other_user}","gists_url":"https://api.github.com/users/crisbeto/gists{/gist_id}","starred_url":"https://api.github.com/users/crisbeto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisbeto/subscriptions","organizations_url":"https://api.github.com/users/crisbeto/orgs","repos_url":"https://api.github.com/users/crisbeto/repos","events_url":"https://api.github.com/users/crisbeto/events{/privacy}","received_events_url":"https://api.github.com/users/crisbeto/received_events","type":"User","site_admin":false},"repo":{"id":51659231,"name":"material","full_name":"crisbeto/material","owner":{"login":"crisbeto","id":4450522,"avatar_url":"https://avatars.githubusercontent.com/u/4450522?v=3","gravatar_id":"","url":"https://api.github.com/users/crisbeto","html_url":"https://github.com/crisbeto","followers_url":"https://api.github.com/users/crisbeto/followers","following_url":"https://api.github.com/users/crisbeto/following{/other_user}","gists_url":"https://api.github.com/users/crisbeto/gists{/gist_id}","starred_url":"https://api.github.com/users/crisbeto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisbeto/subscriptions","organizations_url":"https://api.github.com/users/crisbeto/orgs","repos_url":"https://api.github.com/users/crisbeto/repos","events_url":"https://api.github.com/users/crisbeto/events{/privacy}","received_events_url":"https://api.github.com/users/crisbeto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/crisbeto/material","description":"Material design for Angular","fork":true,"url":"https://api.github.com/repos/crisbeto/material","forks_url":"https://api.github.com/repos/crisbeto/material/forks","keys_url":"https://api.github.com/repos/crisbeto/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crisbeto/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crisbeto/material/teams","hooks_url":"https://api.github.com/repos/crisbeto/material/hooks","issue_events_url":"https://api.github.com/repos/crisbeto/material/issues/events{/number}","events_url":"https://api.github.com/repos/crisbeto/material/events","assignees_url":"https://api.github.com/repos/crisbeto/material/assignees{/user}","branches_url":"https://api.github.com/repos/crisbeto/material/branches{/branch}","tags_url":"https://api.github.com/repos/crisbeto/material/tags","blobs_url":"https://api.github.com/repos/crisbeto/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crisbeto/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crisbeto/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/crisbeto/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crisbeto/material/statuses/{sha}","languages_url":"https://api.github.com/repos/crisbeto/material/languages","stargazers_url":"https://api.github.com/repos/crisbeto/material/stargazers","contributors_url":"https://api.github.com/repos/crisbeto/material/contributors","subscribers_url":"https://api.github.com/repos/crisbeto/material/subscribers","subscription_url":"https://api.github.com/repos/crisbeto/material/subscription","commits_url":"https://api.github.com/repos/crisbeto/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/crisbeto/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/crisbeto/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/crisbeto/material/issues/comments{/number}","contents_url":"https://api.github.com/repos/crisbeto/material/contents/{+path}","compare_url":"https://api.github.com/repos/crisbeto/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crisbeto/material/merges","archive_url":"https://api.github.com/repos/crisbeto/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crisbeto/material/downloads","issues_url":"https://api.github.com/repos/crisbeto/material/issues{/number}","pulls_url":"https://api.github.com/repos/crisbeto/material/pulls{/number}","milestones_url":"https://api.github.com/repos/crisbeto/material/milestones{/number}","notifications_url":"https://api.github.com/repos/crisbeto/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crisbeto/material/labels{/name}","releases_url":"https://api.github.com/repos/crisbeto/material/releases{/id}","deployments_url":"https://api.github.com/repos/crisbeto/material/deployments","created_at":"2016-02-13T18:29:24Z","updated_at":"2016-09-12T16:05:41Z","pushed_at":"2016-09-13T21:05:11Z","git_url":"git://github.com/crisbeto/material.git","ssh_url":"git@github.com:crisbeto/material.git","clone_url":"https://github.com/crisbeto/material.git","svn_url":"https://github.com/crisbeto/material","homepage":"https://material.angularjs.org/","size":44657,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"7cdd32ac986ce4ab835f00ecbf700d1c9eaea511","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":21399598,"name":"material","full_name":"angular/material","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/material","description":"Material design for Angular","fork":false,"url":"https://api.github.com/repos/angular/material","forks_url":"https://api.github.com/repos/angular/material/forks","keys_url":"https://api.github.com/repos/angular/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/material/teams","hooks_url":"https://api.github.com/repos/angular/material/hooks","issue_events_url":"https://api.github.com/repos/angular/material/issues/events{/number}","events_url":"https://api.github.com/repos/angular/material/events","assignees_url":"https://api.github.com/repos/angular/material/assignees{/user}","branches_url":"https://api.github.com/repos/angular/material/branches{/branch}","tags_url":"https://api.github.com/repos/angular/material/tags","blobs_url":"https://api.github.com/repos/angular/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/material/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/material/languages","stargazers_url":"https://api.github.com/repos/angular/material/stargazers","contributors_url":"https://api.github.com/repos/angular/material/contributors","subscribers_url":"https://api.github.com/repos/angular/material/subscribers","subscription_url":"https://api.github.com/repos/angular/material/subscription","commits_url":"https://api.github.com/repos/angular/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/material/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/material/contents/{+path}","compare_url":"https://api.github.com/repos/angular/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/material/merges","archive_url":"https://api.github.com/repos/angular/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/material/downloads","issues_url":"https://api.github.com/repos/angular/material/issues{/number}","pulls_url":"https://api.github.com/repos/angular/material/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/material/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/material/labels{/name}","releases_url":"https://api.github.com/repos/angular/material/releases{/id}","deployments_url":"https://api.github.com/repos/angular/material/deployments","created_at":"2014-07-01T19:20:06Z","updated_at":"2016-09-13T23:51:54Z","pushed_at":"2016-09-13T21:41:17Z","git_url":"git://github.com/angular/material.git","ssh_url":"git@github.com:angular/material.git","clone_url":"https://github.com/angular/material.git","svn_url":"https://github.com/angular/material","homepage":"https://material.angularjs.org/","size":81980,"stargazers_count":14426,"watchers_count":14426,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3035,"mirror_url":null,"open_issues_count":299,"forks":3035,"open_issues":299,"watchers":14426,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/9574"},"html":{"href":"https://github.com/angular/material/pull/9574"},"issue":{"href":"https://api.github.com/repos/angular/material/issues/9574"},"comments":{"href":"https://api.github.com/repos/angular/material/issues/9574/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/material/pulls/9574/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/material/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/material/pulls/9574/commits"},"statuses":{"href":"https://api.github.com/repos/angular/material/statuses/760f3169599961fbcf87cc15b3b5c99df7e6f2b8"}}}}
{"actor":{"display_login":"crisbeto"}}