{"action":"created","comment":{"url":"https://api.github.com/repos/jadu/pulsar/pulls/comments/145734673","pull_request_review_id":70578425,"id":145734673,"diff_hunk":"@@ -0,0 +1,138 @@\n+class StickyScrollBarComponent {\n+\n+    /**\n+     * StickyScrollBarComponent\n+     * @constructor\n+     * @param {jQuery} $rootWindow - jQuery wrapper of the window object\n+     * @param {jQuery} $html - jQuery wrapper of the html node\n+     */\n+    constructor ($rootWindow, $html) {\n+        this.$elementWithStickyScrollBar = {};\n+        this.$window = $rootWindow;\n+        this.$html = $html;\n+        this.$stickyScrollBar = $('<div class=\"sticky-scrollbar\"><div class=\"sticky-scrollbar__inner\"></div></div>');\n+        this.$stickyScrollBarInner = this.$stickyScrollBar.children();\n+        // cache methods with context\n+        this.scrollStickyScrollBarWithContext = this.scrollStickyScrollBar.bind(this);\n+        this.scrollElementWithStickyScrollBarByScrollBarWithContext = this.scrollElementWithStickyScrollBarByScrollBar.bind(this);\n+        this.updateStickyScrollBarWithContext = this.updateStickyScrollBar.bind(this);\n+    }\n+\n+    /**\n+     * Initialise\n+     * @param {jQuery} $element - jQuery object of the element that requires a sticky scroll bar\n+     */\n+    init ($element) {\n+        if (typeof $element === 'undefined' || !$element) {\n+            throw new Error('an element to add the scroller to must be passed to StickyScrollBarComponent');\n+        }\n+\n+        if (typeof this.$window === 'undefined' || !this.$window) {\n+            throw new Error('window must be passed to StickyScrollBarComponent');\n+        }\n+\n+        if (typeof this.$html === 'undefined' || !this.$html) {\n+            throw new Error('$html must be passed to StickyScrollBarComponent');\n+        }\n+\n+        // Set $elementWithStickyScrollBar\n+        this.$elementWithStickyScrollBar = $element;\n+    \n+        // Add the sticky scroll bar\n+        this.$stickyScrollBar.appendTo(this.$elementWithStickyScrollBar);\n+\n+        // Init the sticky scroll bar\n+        this.$stickyScrollBar\n+            .addClass('u-display-none')\n+            .on('scroll', this.scrollElementWithStickyScrollBarByScrollBarWithContext);\n+\n+        // Call on load\n+        this.updateStickyScrollBarWithContext();\n+\n+        // Call on scroll and window resize\n+        this.$window.on('scroll resize', this.updateStickyScrollBarWithContext);\n+    }\n+\n+    /**\n+     * Set $elementWithStickyScrollBar scroll when scrolled by sticky scroll bar\n+     */\n+    scrollElementWithStickyScrollBarByScrollBar () {\n+        this.$elementWithStickyScrollBar.scrollLeft(this.$stickyScrollBar.scrollLeft());\n+    }\n+\n+    /**\n+     * Set $stickyScrollBar scroll when $elementWithStickyScrollBar is scrolled\n+     */\n+    scrollStickyScrollBar () {\n+        this.$stickyScrollBar.scrollLeft(this.$elementWithStickyScrollBar.scrollLeft());\n+    }\n+\n+    /**\n+     * Toggle visiblity of sticky scroll bar\n+     */\n+    showStickyScrollBar (option) {\n+        if (option) {\n+            this.$stickyScrollBar.removeClass('u-display-none');\n+        } else {\n+            this.$stickyScrollBar.addClass('u-display-none');\n+        }\n+    }\n+\n+    /**\n+     * Update sticky scroll bar visibility, thumb position and width\n+     */\n+    updateStickyScrollBar () {\n+        const top = this.$elementWithStickyScrollBar.offset().top;\n+        const bottom = top + this.$elementWithStickyScrollBar.height();\n+        const topOffset = 30;\n+        let viewportBottom;\n+\n+        // Allow for footer\n+        if (this.$html.find('.footer').css('position') === 'fixed') {\n+            viewportBottom = this.$window.scrollTop() + this.$window.height() - this.$html.find('.footer').outerHeight();\n+        } else {\n+            viewportBottom = this.$window.scrollTop() + this.$window.height();\n+        }\n+\n+        // Check if the $elementWithStickyScrollBar is visible but bottom is outside of viewport\n+        if (top + topOffset < viewportBottom && bottom > viewportBottom) {\n+","path":"js/StickyScrollBarComponent.js","position":99,"original_position":99,"commit_id":"e234fef09ac5f223abfdddaf9882d7379e76e1ee","original_commit_id":"e234fef09ac5f223abfdddaf9882d7379e76e1ee","user":{"login":"jamesjacobs","id":756393,"avatar_url":"https://avatars3.githubusercontent.com/u/756393?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesjacobs","html_url":"https://github.com/jamesjacobs","followers_url":"https://api.github.com/users/jamesjacobs/followers","following_url":"https://api.github.com/users/jamesjacobs/following{/other_user}","gists_url":"https://api.github.com/users/jamesjacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesjacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesjacobs/subscriptions","organizations_url":"https://api.github.com/users/jamesjacobs/orgs","repos_url":"https://api.github.com/users/jamesjacobs/repos","events_url":"https://api.github.com/users/jamesjacobs/events{/privacy}","received_events_url":"https://api.github.com/users/jamesjacobs/received_events","type":"User","site_admin":false},"body":"Added for readability as the line below is also a comment. Personal preference, happy to remove.","created_at":"2017-10-19T15:23:59Z","updated_at":"2017-10-19T15:23:59Z","html_url":"https://github.com/jadu/pulsar/pull/675#discussion_r145734673","pull_request_url":"https://api.github.com/repos/jadu/pulsar/pulls/675","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/jadu/pulsar/pulls/comments/145734673"},"html":{"href":"https://github.com/jadu/pulsar/pull/675#discussion_r145734673"},"pull_request":{"href":"https://api.github.com/repos/jadu/pulsar/pulls/675"}},"in_reply_to_id":145714377},"pull_request":{"url":"https://api.github.com/repos/jadu/pulsar/pulls/675","id":147056382,"html_url":"https://github.com/jadu/pulsar/pull/675","diff_url":"https://github.com/jadu/pulsar/pull/675.diff","patch_url":"https://github.com/jadu/pulsar/pull/675.patch","issue_url":"https://api.github.com/repos/jadu/pulsar/issues/675","number":675,"state":"open","locked":false,"title":"658 sticky scroll bar","user":{"login":"jamesjacobs","id":756393,"avatar_url":"https://avatars3.githubusercontent.com/u/756393?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesjacobs","html_url":"https://github.com/jamesjacobs","followers_url":"https://api.github.com/users/jamesjacobs/followers","following_url":"https://api.github.com/users/jamesjacobs/following{/other_user}","gists_url":"https://api.github.com/users/jamesjacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesjacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesjacobs/subscriptions","organizations_url":"https://api.github.com/users/jamesjacobs/orgs","repos_url":"https://api.github.com/users/jamesjacobs/repos","events_url":"https://api.github.com/users/jamesjacobs/events{/privacy}","received_events_url":"https://api.github.com/users/jamesjacobs/received_events","type":"User","site_admin":false},"body":"Horizontally scrolling tables now have a sticky \"floating\" scroll bar to aid with navigating large tables with many columns and rows.\r\n\r\n![sticky-scroll-bar](https://user-images.githubusercontent.com/756393/31670720-200f8e6e-b350-11e7-9df0-bc64fc4f7745.gif)\r\n\r\nTested in:\r\n\r\n- [x] IE9\r\n- [x] IE10\r\n- [x] IE11\r\n- [x] Edge\r\n- [x] Chrome\r\n- [x] Safari\r\n- [x] Firefox \r\n\r\nFixed #658 ","created_at":"2017-10-17T14:31:19Z","updated_at":"2017-10-19T15:23:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc29f0f0d0cd94c385e55ab164779eac82d08aea","assignee":{"login":"jamesjacobs","id":756393,"avatar_url":"https://avatars3.githubusercontent.com/u/756393?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesjacobs","html_url":"https://github.com/jamesjacobs","followers_url":"https://api.github.com/users/jamesjacobs/followers","following_url":"https://api.github.com/users/jamesjacobs/following{/other_user}","gists_url":"https://api.github.com/users/jamesjacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesjacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesjacobs/subscriptions","organizations_url":"https://api.github.com/users/jamesjacobs/orgs","repos_url":"https://api.github.com/users/jamesjacobs/repos","events_url":"https://api.github.com/users/jamesjacobs/events{/privacy}","received_events_url":"https://api.github.com/users/jamesjacobs/received_events","type":"User","site_admin":false},"assignees":[{"login":"jamesjacobs","id":756393,"avatar_url":"https://avatars3.githubusercontent.com/u/756393?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesjacobs","html_url":"https://github.com/jamesjacobs","followers_url":"https://api.github.com/users/jamesjacobs/followers","following_url":"https://api.github.com/users/jamesjacobs/following{/other_user}","gists_url":"https://api.github.com/users/jamesjacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesjacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesjacobs/subscriptions","organizations_url":"https://api.github.com/users/jamesjacobs/orgs","repos_url":"https://api.github.com/users/jamesjacobs/repos","events_url":"https://api.github.com/users/jamesjacobs/events{/privacy}","received_events_url":"https://api.github.com/users/jamesjacobs/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/jadu/pulsar/pulls/675/commits","review_comments_url":"https://api.github.com/repos/jadu/pulsar/pulls/675/comments","review_comment_url":"https://api.github.com/repos/jadu/pulsar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jadu/pulsar/issues/675/comments","statuses_url":"https://api.github.com/repos/jadu/pulsar/statuses/e234fef09ac5f223abfdddaf9882d7379e76e1ee","head":{"label":"jadu:658_sticky-scroll-bar","ref":"658_sticky-scroll-bar","sha":"e234fef09ac5f223abfdddaf9882d7379e76e1ee","user":{"login":"jadu","id":2369677,"avatar_url":"https://avatars2.githubusercontent.com/u/2369677?v=4","gravatar_id":"","url":"https://api.github.com/users/jadu","html_url":"https://github.com/jadu","followers_url":"https://api.github.com/users/jadu/followers","following_url":"https://api.github.com/users/jadu/following{/other_user}","gists_url":"https://api.github.com/users/jadu/gists{/gist_id}","starred_url":"https://api.github.com/users/jadu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadu/subscriptions","organizations_url":"https://api.github.com/users/jadu/orgs","repos_url":"https://api.github.com/users/jadu/repos","events_url":"https://api.github.com/users/jadu/events{/privacy}","received_events_url":"https://api.github.com/users/jadu/received_events","type":"Organization","site_admin":false},"repo":{"id":49197651,"name":"pulsar","full_name":"jadu/pulsar","owner":{"login":"jadu","id":2369677,"avatar_url":"https://avatars2.githubusercontent.com/u/2369677?v=4","gravatar_id":"","url":"https://api.github.com/users/jadu","html_url":"https://github.com/jadu","followers_url":"https://api.github.com/users/jadu/followers","following_url":"https://api.github.com/users/jadu/following{/other_user}","gists_url":"https://api.github.com/users/jadu/gists{/gist_id}","starred_url":"https://api.github.com/users/jadu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadu/subscriptions","organizations_url":"https://api.github.com/users/jadu/orgs","repos_url":"https://api.github.com/users/jadu/repos","events_url":"https://api.github.com/users/jadu/events{/privacy}","received_events_url":"https://api.github.com/users/jadu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jadu/pulsar","description":"The User Experience and Interface framework for the Jadu Continuum Platform","fork":false,"url":"https://api.github.com/repos/jadu/pulsar","forks_url":"https://api.github.com/repos/jadu/pulsar/forks","keys_url":"https://api.github.com/repos/jadu/pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jadu/pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jadu/pulsar/teams","hooks_url":"https://api.github.com/repos/jadu/pulsar/hooks","issue_events_url":"https://api.github.com/repos/jadu/pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/jadu/pulsar/events","assignees_url":"https://api.github.com/repos/jadu/pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/jadu/pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/jadu/pulsar/tags","blobs_url":"https://api.github.com/repos/jadu/pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jadu/pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jadu/pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/jadu/pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jadu/pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/jadu/pulsar/languages","stargazers_url":"https://api.github.com/repos/jadu/pulsar/stargazers","contributors_url":"https://api.github.com/repos/jadu/pulsar/contributors","subscribers_url":"https://api.github.com/repos/jadu/pulsar/subscribers","subscription_url":"https://api.github.com/repos/jadu/pulsar/subscription","commits_url":"https://api.github.com/repos/jadu/pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/jadu/pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/jadu/pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/jadu/pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/jadu/pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/jadu/pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jadu/pulsar/merges","archive_url":"https://api.github.com/repos/jadu/pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jadu/pulsar/downloads","issues_url":"https://api.github.com/repos/jadu/pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/jadu/pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/jadu/pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/jadu/pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jadu/pulsar/labels{/name}","releases_url":"https://api.github.com/repos/jadu/pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/jadu/pulsar/deployments","created_at":"2016-01-07T10:20:34Z","updated_at":"2017-07-18T04:05:02Z","pushed_at":"2017-10-19T13:44:48Z","git_url":"git://github.com/jadu/pulsar.git","ssh_url":"git@github.com:jadu/pulsar.git","clone_url":"https://github.com/jadu/pulsar.git","svn_url":"https://github.com/jadu/pulsar","homepage":"https://jadu.github.io/pulsar/","size":141272,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":24,"forks":2,"open_issues":24,"watchers":14,"default_branch":"develop"}},"base":{"label":"jadu:develop","ref":"develop","sha":"813f27174d3ae501ac71a1ad0986148d8628a1e1","user":{"login":"jadu","id":2369677,"avatar_url":"https://avatars2.githubusercontent.com/u/2369677?v=4","gravatar_id":"","url":"https://api.github.com/users/jadu","html_url":"https://github.com/jadu","followers_url":"https://api.github.com/users/jadu/followers","following_url":"https://api.github.com/users/jadu/following{/other_user}","gists_url":"https://api.github.com/users/jadu/gists{/gist_id}","starred_url":"https://api.github.com/users/jadu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadu/subscriptions","organizations_url":"https://api.github.com/users/jadu/orgs","repos_url":"https://api.github.com/users/jadu/repos","events_url":"https://api.github.com/users/jadu/events{/privacy}","received_events_url":"https://api.github.com/users/jadu/received_events","type":"Organization","site_admin":false},"repo":{"id":49197651,"name":"pulsar","full_name":"jadu/pulsar","owner":{"login":"jadu","id":2369677,"avatar_url":"https://avatars2.githubusercontent.com/u/2369677?v=4","gravatar_id":"","url":"https://api.github.com/users/jadu","html_url":"https://github.com/jadu","followers_url":"https://api.github.com/users/jadu/followers","following_url":"https://api.github.com/users/jadu/following{/other_user}","gists_url":"https://api.github.com/users/jadu/gists{/gist_id}","starred_url":"https://api.github.com/users/jadu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadu/subscriptions","organizations_url":"https://api.github.com/users/jadu/orgs","repos_url":"https://api.github.com/users/jadu/repos","events_url":"https://api.github.com/users/jadu/events{/privacy}","received_events_url":"https://api.github.com/users/jadu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jadu/pulsar","description":"The User Experience and Interface framework for the Jadu Continuum Platform","fork":false,"url":"https://api.github.com/repos/jadu/pulsar","forks_url":"https://api.github.com/repos/jadu/pulsar/forks","keys_url":"https://api.github.com/repos/jadu/pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jadu/pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jadu/pulsar/teams","hooks_url":"https://api.github.com/repos/jadu/pulsar/hooks","issue_events_url":"https://api.github.com/repos/jadu/pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/jadu/pulsar/events","assignees_url":"https://api.github.com/repos/jadu/pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/jadu/pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/jadu/pulsar/tags","blobs_url":"https://api.github.com/repos/jadu/pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jadu/pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jadu/pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/jadu/pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jadu/pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/jadu/pulsar/languages","stargazers_url":"https://api.github.com/repos/jadu/pulsar/stargazers","contributors_url":"https://api.github.com/repos/jadu/pulsar/contributors","subscribers_url":"https://api.github.com/repos/jadu/pulsar/subscribers","subscription_url":"https://api.github.com/repos/jadu/pulsar/subscription","commits_url":"https://api.github.com/repos/jadu/pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/jadu/pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/jadu/pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/jadu/pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/jadu/pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/jadu/pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jadu/pulsar/merges","archive_url":"https://api.github.com/repos/jadu/pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jadu/pulsar/downloads","issues_url":"https://api.github.com/repos/jadu/pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/jadu/pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/jadu/pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/jadu/pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jadu/pulsar/labels{/name}","releases_url":"https://api.github.com/repos/jadu/pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/jadu/pulsar/deployments","created_at":"2016-01-07T10:20:34Z","updated_at":"2017-07-18T04:05:02Z","pushed_at":"2017-10-19T13:44:48Z","git_url":"git://github.com/jadu/pulsar.git","ssh_url":"git@github.com:jadu/pulsar.git","clone_url":"https://github.com/jadu/pulsar.git","svn_url":"https://github.com/jadu/pulsar","homepage":"https://jadu.github.io/pulsar/","size":141272,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":24,"forks":2,"open_issues":24,"watchers":14,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/jadu/pulsar/pulls/675"},"html":{"href":"https://github.com/jadu/pulsar/pull/675"},"issue":{"href":"https://api.github.com/repos/jadu/pulsar/issues/675"},"comments":{"href":"https://api.github.com/repos/jadu/pulsar/issues/675/comments"},"review_comments":{"href":"https://api.github.com/repos/jadu/pulsar/pulls/675/comments"},"review_comment":{"href":"https://api.github.com/repos/jadu/pulsar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jadu/pulsar/pulls/675/commits"},"statuses":{"href":"https://api.github.com/repos/jadu/pulsar/statuses/e234fef09ac5f223abfdddaf9882d7379e76e1ee"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jamesjacobs"}}