{"action":"closed","number":11,"pull_request":{"url":"https://api.github.com/repos/iamdustan/smoothscroll/pulls/11","id":37531319,"html_url":"https://github.com/iamdustan/smoothscroll/pull/11","diff_url":"https://github.com/iamdustan/smoothscroll/pull/11.diff","patch_url":"https://github.com/iamdustan/smoothscroll/pull/11.patch","issue_url":"https://api.github.com/repos/iamdustan/smoothscroll/issues/11","number":11,"state":"closed","locked":false,"title":"Refactor","user":{"login":"jeremenichelli","id":3856481,"avatar_url":"https://avatars.githubusercontent.com/u/3856481?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremenichelli","html_url":"https://github.com/jeremenichelli","followers_url":"https://api.github.com/users/jeremenichelli/followers","following_url":"https://api.github.com/users/jeremenichelli/following{/other_user}","gists_url":"https://api.github.com/users/jeremenichelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremenichelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremenichelli/subscriptions","organizations_url":"https://api.github.com/users/jeremenichelli/orgs","repos_url":"https://api.github.com/users/jeremenichelli/repos","events_url":"https://api.github.com/users/jeremenichelli/events{/privacy}","received_events_url":"https://api.github.com/users/jeremenichelli/received_events","type":"User","site_admin":false},"body":"### Suggestion\r\nSee diff in unified view.\r\n\r\n### Refactor\r\nList of things improved:\r\n - documentation and comments for specific decisions\r\n - group all private functions at the top of the script for better organization and code readability\r\n - pass window, document and undefined variables to improve performance inside closure\r\n - modified ```bailOut``` method to return ```true``` if behavior is **auto** or **undefined** and throw error if behavior is not supported as Firefox does in its implementation of the standard\r\n - improve ```findScrollableParent```method to stop if node is invalid and avoid crashing\r\n - group local variables declaration inside functions\r\n - group overrides at the end of the script\r\n\r\n*left other comments and explanations over the diff file*\r\n\r\n*tested in Chrome 43*","created_at":"2015-06-12T04:33:07Z","updated_at":"2015-06-12T20:31:16Z","closed_at":"2015-06-12T20:31:16Z","merged_at":"2015-06-12T20:31:16Z","merge_commit_sha":"a7cbd467fb486671f35aa0d1db57321750c738e5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iamdustan/smoothscroll/pulls/11/commits","review_comments_url":"https://api.github.com/repos/iamdustan/smoothscroll/pulls/11/comments","review_comment_url":"https://api.github.com/repos/iamdustan/smoothscroll/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iamdustan/smoothscroll/issues/11/comments","statuses_url":"https://api.github.com/repos/iamdustan/smoothscroll/statuses/9af44b5a62498706f6e8c8cd33361fd8d5f89de2","head":{"label":"jeremenichelli:jeremenichelli/refactor","ref":"jeremenichelli/refactor","sha":"9af44b5a62498706f6e8c8cd33361fd8d5f89de2","user":{"login":"jeremenichelli","id":3856481,"avatar_url":"https://avatars.githubusercontent.com/u/3856481?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremenichelli","html_url":"https://github.com/jeremenichelli","followers_url":"https://api.github.com/users/jeremenichelli/followers","following_url":"https://api.github.com/users/jeremenichelli/following{/other_user}","gists_url":"https://api.github.com/users/jeremenichelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremenichelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremenichelli/subscriptions","organizations_url":"https://api.github.com/users/jeremenichelli/orgs","repos_url":"https://api.github.com/users/jeremenichelli/repos","events_url":"https://api.github.com/users/jeremenichelli/events{/privacy}","received_events_url":"https://api.github.com/users/jeremenichelli/received_events","type":"User","site_admin":false},"repo":{"id":36532537,"name":"smoothscroll","full_name":"jeremenichelli/smoothscroll","owner":{"login":"jeremenichelli","id":3856481,"avatar_url":"https://avatars.githubusercontent.com/u/3856481?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremenichelli","html_url":"https://github.com/jeremenichelli","followers_url":"https://api.github.com/users/jeremenichelli/followers","following_url":"https://api.github.com/users/jeremenichelli/following{/other_user}","gists_url":"https://api.github.com/users/jeremenichelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremenichelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremenichelli/subscriptions","organizations_url":"https://api.github.com/users/jeremenichelli/orgs","repos_url":"https://api.github.com/users/jeremenichelli/repos","events_url":"https://api.github.com/users/jeremenichelli/events{/privacy}","received_events_url":"https://api.github.com/users/jeremenichelli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeremenichelli/smoothscroll","description":"Polyfill for window.scrollTo(x, y, 'smooth');","fork":true,"url":"https://api.github.com/repos/jeremenichelli/smoothscroll","forks_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/forks","keys_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/teams","hooks_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/hooks","issue_events_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/issues/events{/number}","events_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/events","assignees_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/assignees{/user}","branches_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/branches{/branch}","tags_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/tags","blobs_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/statuses/{sha}","languages_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/languages","stargazers_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/stargazers","contributors_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/contributors","subscribers_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/subscribers","subscription_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/subscription","commits_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/contents/{+path}","compare_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/merges","archive_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/downloads","issues_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/issues{/number}","pulls_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/pulls{/number}","milestones_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/milestones{/number}","notifications_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/labels{/name}","releases_url":"https://api.github.com/repos/jeremenichelli/smoothscroll/releases{/id}","created_at":"2015-05-29T22:33:37Z","updated_at":"2015-05-29T22:33:37Z","pushed_at":"2015-06-12T17:23:32Z","git_url":"git://github.com/jeremenichelli/smoothscroll.git","ssh_url":"git@github.com:jeremenichelli/smoothscroll.git","clone_url":"https://github.com/jeremenichelli/smoothscroll.git","svn_url":"https://github.com/jeremenichelli/smoothscroll","homepage":null,"size":338,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"iamdustan:master","ref":"master","sha":"03c0452f6b7d5dc0ba67c987f82d83bb178e26b5","user":{"login":"iamdustan","id":227879,"avatar_url":"https://avatars.githubusercontent.com/u/227879?v=3","gravatar_id":"","url":"https://api.github.com/users/iamdustan","html_url":"https://github.com/iamdustan","followers_url":"https://api.github.com/users/iamdustan/followers","following_url":"https://api.github.com/users/iamdustan/following{/other_user}","gists_url":"https://api.github.com/users/iamdustan/gists{/gist_id}","starred_url":"https://api.github.com/users/iamdustan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamdustan/subscriptions","organizations_url":"https://api.github.com/users/iamdustan/orgs","repos_url":"https://api.github.com/users/iamdustan/repos","events_url":"https://api.github.com/users/iamdustan/events{/privacy}","received_events_url":"https://api.github.com/users/iamdustan/received_events","type":"User","site_admin":false},"repo":{"id":11966941,"name":"smoothscroll","full_name":"iamdustan/smoothscroll","owner":{"login":"iamdustan","id":227879,"avatar_url":"https://avatars.githubusercontent.com/u/227879?v=3","gravatar_id":"","url":"https://api.github.com/users/iamdustan","html_url":"https://github.com/iamdustan","followers_url":"https://api.github.com/users/iamdustan/followers","following_url":"https://api.github.com/users/iamdustan/following{/other_user}","gists_url":"https://api.github.com/users/iamdustan/gists{/gist_id}","starred_url":"https://api.github.com/users/iamdustan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamdustan/subscriptions","organizations_url":"https://api.github.com/users/iamdustan/orgs","repos_url":"https://api.github.com/users/iamdustan/repos","events_url":"https://api.github.com/users/iamdustan/events{/privacy}","received_events_url":"https://api.github.com/users/iamdustan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iamdustan/smoothscroll","description":"Polyfill for window.scrollTo(x, y, 'smooth');","fork":false,"url":"https://api.github.com/repos/iamdustan/smoothscroll","forks_url":"https://api.github.com/repos/iamdustan/smoothscroll/forks","keys_url":"https://api.github.com/repos/iamdustan/smoothscroll/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iamdustan/smoothscroll/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iamdustan/smoothscroll/teams","hooks_url":"https://api.github.com/repos/iamdustan/smoothscroll/hooks","issue_events_url":"https://api.github.com/repos/iamdustan/smoothscroll/issues/events{/number}","events_url":"https://api.github.com/repos/iamdustan/smoothscroll/events","assignees_url":"https://api.github.com/repos/iamdustan/smoothscroll/assignees{/user}","branches_url":"https://api.github.com/repos/iamdustan/smoothscroll/branches{/branch}","tags_url":"https://api.github.com/repos/iamdustan/smoothscroll/tags","blobs_url":"https://api.github.com/repos/iamdustan/smoothscroll/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iamdustan/smoothscroll/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iamdustan/smoothscroll/git/refs{/sha}","trees_url":"https://api.github.com/repos/iamdustan/smoothscroll/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iamdustan/smoothscroll/statuses/{sha}","languages_url":"https://api.github.com/repos/iamdustan/smoothscroll/languages","stargazers_url":"https://api.github.com/repos/iamdustan/smoothscroll/stargazers","contributors_url":"https://api.github.com/repos/iamdustan/smoothscroll/contributors","subscribers_url":"https://api.github.com/repos/iamdustan/smoothscroll/subscribers","subscription_url":"https://api.github.com/repos/iamdustan/smoothscroll/subscription","commits_url":"https://api.github.com/repos/iamdustan/smoothscroll/commits{/sha}","git_commits_url":"https://api.github.com/repos/iamdustan/smoothscroll/git/commits{/sha}","comments_url":"https://api.github.com/repos/iamdustan/smoothscroll/comments{/number}","issue_comment_url":"https://api.github.com/repos/iamdustan/smoothscroll/issues/comments{/number}","contents_url":"https://api.github.com/repos/iamdustan/smoothscroll/contents/{+path}","compare_url":"https://api.github.com/repos/iamdustan/smoothscroll/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iamdustan/smoothscroll/merges","archive_url":"https://api.github.com/repos/iamdustan/smoothscroll/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iamdustan/smoothscroll/downloads","issues_url":"https://api.github.com/repos/iamdustan/smoothscroll/issues{/number}","pulls_url":"https://api.github.com/repos/iamdustan/smoothscroll/pulls{/number}","milestones_url":"https://api.github.com/repos/iamdustan/smoothscroll/milestones{/number}","notifications_url":"https://api.github.com/repos/iamdustan/smoothscroll/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iamdustan/smoothscroll/labels{/name}","releases_url":"https://api.github.com/repos/iamdustan/smoothscroll/releases{/id}","created_at":"2013-08-08T03:41:53Z","updated_at":"2015-06-12T02:02:47Z","pushed_at":"2015-06-12T20:31:16Z","git_url":"git://github.com/iamdustan/smoothscroll.git","ssh_url":"git@github.com:iamdustan/smoothscroll.git","clone_url":"https://github.com/iamdustan/smoothscroll.git","svn_url":"https://github.com/iamdustan/smoothscroll","homepage":null,"size":275,"stargazers_count":31,"watchers_count":31,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iamdustan/smoothscroll/pulls/11"},"html":{"href":"https://github.com/iamdustan/smoothscroll/pull/11"},"issue":{"href":"https://api.github.com/repos/iamdustan/smoothscroll/issues/11"},"comments":{"href":"https://api.github.com/repos/iamdustan/smoothscroll/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/iamdustan/smoothscroll/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/iamdustan/smoothscroll/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iamdustan/smoothscroll/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/iamdustan/smoothscroll/statuses/9af44b5a62498706f6e8c8cd33361fd8d5f89de2"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"iamdustan","id":227879,"avatar_url":"https://avatars.githubusercontent.com/u/227879?v=3","gravatar_id":"","url":"https://api.github.com/users/iamdustan","html_url":"https://github.com/iamdustan","followers_url":"https://api.github.com/users/iamdustan/followers","following_url":"https://api.github.com/users/iamdustan/following{/other_user}","gists_url":"https://api.github.com/users/iamdustan/gists{/gist_id}","starred_url":"https://api.github.com/users/iamdustan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamdustan/subscriptions","organizations_url":"https://api.github.com/users/iamdustan/orgs","repos_url":"https://api.github.com/users/iamdustan/repos","events_url":"https://api.github.com/users/iamdustan/events{/privacy}","received_events_url":"https://api.github.com/users/iamdustan/received_events","type":"User","site_admin":false},"comments":4,"review_comments":27,"commits":2,"additions":176,"deletions":95,"changed_files":3}}