{"action":"created","comment":{"url":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/comments/78010079","id":78010079,"diff_hunk":"@@ -328,6 +330,81 @@ export default Mixin.create({\n     this._tellGroup('prepare');\n     this.set('isDragging', true);\n     this.sendAction('onDragStart', this.get('model'));\n+\n+    this._scrollOnEdges(drag);\n+  },\n+\n+  /**\n+    The maximum scroll speed when dragging element.\n+    @property maxScrollSpeed\n+    @default 20\n+   */\n+  maxScrollSpeed: 20,\n+\n+  _scrollOnEdges(drag) {\n+    let groupDirection = this.get('group.direction');\n+    let $element = this.$();\n+    let scrollContainer = new ScrollContainer(scrollParent($element)[0]);\n+    let itemContainer = {\n+      width: $element.width(),\n+      height: $element.height(),\n+      get left() {\n+        return $element.offset().left;\n+      },\n+      get right() {\n+        return this.left + this.width;\n+      },\n+      get top() {\n+        return $element.offset().top;\n+      },\n+      get bottom() {\n+        return this.top + this.height;\n+      }\n+    };\n+\n+    let leadingEdgeKey, trailingEdgeKey, scrollKey;\n+    if (groupDirection === 'x') {\n+      leadingEdgeKey = 'left';\n+      trailingEdgeKey = 'right';\n+      scrollKey = 'scrollLeft';\n+    } else {\n+      leadingEdgeKey = 'top';\n+      trailingEdgeKey = 'bottom';\n+      scrollKey = 'scrollTop';\n+    }\n+\n+    // Set a trigger padding that will start scrolling\n+    // the box when the item reaches within padding pixels\n+    // of the edge of the scroll container.\n+    let checkScrollBounds = () => {\n+      let leadingEdge = itemContainer[leadingEdgeKey];\n+      let trailingEdge = itemContainer[trailingEdgeKey];\n+      let scroll = scrollContainer[scrollKey]();\n+\n+      let delta = 0;\n+      if (trailingEdge >= scrollContainer[trailingEdgeKey]) {\n+        delta = trailingEdge - scrollContainer[trailingEdgeKey];\n+      } else if (leadingEdge <= scrollContainer[leadingEdgeKey]) {\n+        delta = leadingEdge - scrollContainer[leadingEdgeKey];\n+      }\n+\n+      if (delta !== 0) {","path":"addon/mixins/sortable-item.js","position":70,"original_position":70,"commit_id":"c8a32e7a5da07fa4e0d24c05d78bff9dcf40b1ab","original_commit_id":"c8a32e7a5da07fa4e0d24c05d78bff9dcf40b1ab","user":{"login":"tim-evans","id":177701,"avatar_url":"https://avatars.githubusercontent.com/u/177701?v=3","gravatar_id":"","url":"https://api.github.com/users/tim-evans","html_url":"https://github.com/tim-evans","followers_url":"https://api.github.com/users/tim-evans/followers","following_url":"https://api.github.com/users/tim-evans/following{/other_user}","gists_url":"https://api.github.com/users/tim-evans/gists{/gist_id}","starred_url":"https://api.github.com/users/tim-evans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tim-evans/subscriptions","organizations_url":"https://api.github.com/users/tim-evans/orgs","repos_url":"https://api.github.com/users/tim-evans/repos","events_url":"https://api.github.com/users/tim-evans/events{/privacy}","received_events_url":"https://api.github.com/users/tim-evans/received_events","type":"User","site_admin":false},"body":"Sorry, reading the wrong thing! This prevents too many calls to expensive functions ","created_at":"2016-09-08T13:55:14Z","updated_at":"2016-09-08T13:55:14Z","html_url":"https://github.com/jgwhite/ember-sortable/pull/104#discussion_r78010079","pull_request_url":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/comments/78010079"},"html":{"href":"https://github.com/jgwhite/ember-sortable/pull/104#discussion_r78010079"},"pull_request":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/104","id":83848002,"html_url":"https://github.com/jgwhite/ember-sortable/pull/104","diff_url":"https://github.com/jgwhite/ember-sortable/pull/104.diff","patch_url":"https://github.com/jgwhite/ember-sortable/pull/104.patch","issue_url":"https://api.github.com/repos/jgwhite/ember-sortable/issues/104","number":104,"state":"open","locked":false,"title":"Autoscroll while dragging sortable-items","user":{"login":"tim-evans","id":177701,"avatar_url":"https://avatars.githubusercontent.com/u/177701?v=3","gravatar_id":"","url":"https://api.github.com/users/tim-evans","html_url":"https://github.com/tim-evans","followers_url":"https://api.github.com/users/tim-evans/followers","following_url":"https://api.github.com/users/tim-evans/following{/other_user}","gists_url":"https://api.github.com/users/tim-evans/gists{/gist_id}","starred_url":"https://api.github.com/users/tim-evans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tim-evans/subscriptions","organizations_url":"https://api.github.com/users/tim-evans/orgs","repos_url":"https://api.github.com/users/tim-evans/repos","events_url":"https://api.github.com/users/tim-evans/events{/privacy}","received_events_url":"https://api.github.com/users/tim-evans/received_events","type":"User","site_admin":false},"body":"This builds in functionality to scroll the container when a `{{sortable-item}}` reaches the bounding edge of its parent scroll container.\r\n\r\nSome more work is needed to get scrolling smooth when the browser window is the element that should scroll, but it works wonderfully in scrollable containers. To test, you can try dragging items to the edges of the browser window and the page should move :)","created_at":"2016-09-02T18:48:37Z","updated_at":"2016-09-08T13:55:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c41edfa7ba3eae245c17e5a3ea6910da5511e97","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/104/commits","review_comments_url":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/104/comments","review_comment_url":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jgwhite/ember-sortable/issues/104/comments","statuses_url":"https://api.github.com/repos/jgwhite/ember-sortable/statuses/c8a32e7a5da07fa4e0d24c05d78bff9dcf40b1ab","head":{"label":"tim-evans:master","ref":"master","sha":"c8a32e7a5da07fa4e0d24c05d78bff9dcf40b1ab","user":{"login":"tim-evans","id":177701,"avatar_url":"https://avatars.githubusercontent.com/u/177701?v=3","gravatar_id":"","url":"https://api.github.com/users/tim-evans","html_url":"https://github.com/tim-evans","followers_url":"https://api.github.com/users/tim-evans/followers","following_url":"https://api.github.com/users/tim-evans/following{/other_user}","gists_url":"https://api.github.com/users/tim-evans/gists{/gist_id}","starred_url":"https://api.github.com/users/tim-evans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tim-evans/subscriptions","organizations_url":"https://api.github.com/users/tim-evans/orgs","repos_url":"https://api.github.com/users/tim-evans/repos","events_url":"https://api.github.com/users/tim-evans/events{/privacy}","received_events_url":"https://api.github.com/users/tim-evans/received_events","type":"User","site_admin":false},"repo":{"id":67228851,"name":"ember-sortable","full_name":"tim-evans/ember-sortable","owner":{"login":"tim-evans","id":177701,"avatar_url":"https://avatars.githubusercontent.com/u/177701?v=3","gravatar_id":"","url":"https://api.github.com/users/tim-evans","html_url":"https://github.com/tim-evans","followers_url":"https://api.github.com/users/tim-evans/followers","following_url":"https://api.github.com/users/tim-evans/following{/other_user}","gists_url":"https://api.github.com/users/tim-evans/gists{/gist_id}","starred_url":"https://api.github.com/users/tim-evans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tim-evans/subscriptions","organizations_url":"https://api.github.com/users/tim-evans/orgs","repos_url":"https://api.github.com/users/tim-evans/repos","events_url":"https://api.github.com/users/tim-evans/events{/privacy}","received_events_url":"https://api.github.com/users/tim-evans/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tim-evans/ember-sortable","description":"Sortable UI primitives for Ember.js","fork":true,"url":"https://api.github.com/repos/tim-evans/ember-sortable","forks_url":"https://api.github.com/repos/tim-evans/ember-sortable/forks","keys_url":"https://api.github.com/repos/tim-evans/ember-sortable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tim-evans/ember-sortable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tim-evans/ember-sortable/teams","hooks_url":"https://api.github.com/repos/tim-evans/ember-sortable/hooks","issue_events_url":"https://api.github.com/repos/tim-evans/ember-sortable/issues/events{/number}","events_url":"https://api.github.com/repos/tim-evans/ember-sortable/events","assignees_url":"https://api.github.com/repos/tim-evans/ember-sortable/assignees{/user}","branches_url":"https://api.github.com/repos/tim-evans/ember-sortable/branches{/branch}","tags_url":"https://api.github.com/repos/tim-evans/ember-sortable/tags","blobs_url":"https://api.github.com/repos/tim-evans/ember-sortable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tim-evans/ember-sortable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tim-evans/ember-sortable/git/refs{/sha}","trees_url":"https://api.github.com/repos/tim-evans/ember-sortable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tim-evans/ember-sortable/statuses/{sha}","languages_url":"https://api.github.com/repos/tim-evans/ember-sortable/languages","stargazers_url":"https://api.github.com/repos/tim-evans/ember-sortable/stargazers","contributors_url":"https://api.github.com/repos/tim-evans/ember-sortable/contributors","subscribers_url":"https://api.github.com/repos/tim-evans/ember-sortable/subscribers","subscription_url":"https://api.github.com/repos/tim-evans/ember-sortable/subscription","commits_url":"https://api.github.com/repos/tim-evans/ember-sortable/commits{/sha}","git_commits_url":"https://api.github.com/repos/tim-evans/ember-sortable/git/commits{/sha}","comments_url":"https://api.github.com/repos/tim-evans/ember-sortable/comments{/number}","issue_comment_url":"https://api.github.com/repos/tim-evans/ember-sortable/issues/comments{/number}","contents_url":"https://api.github.com/repos/tim-evans/ember-sortable/contents/{+path}","compare_url":"https://api.github.com/repos/tim-evans/ember-sortable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tim-evans/ember-sortable/merges","archive_url":"https://api.github.com/repos/tim-evans/ember-sortable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tim-evans/ember-sortable/downloads","issues_url":"https://api.github.com/repos/tim-evans/ember-sortable/issues{/number}","pulls_url":"https://api.github.com/repos/tim-evans/ember-sortable/pulls{/number}","milestones_url":"https://api.github.com/repos/tim-evans/ember-sortable/milestones{/number}","notifications_url":"https://api.github.com/repos/tim-evans/ember-sortable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tim-evans/ember-sortable/labels{/name}","releases_url":"https://api.github.com/repos/tim-evans/ember-sortable/releases{/id}","deployments_url":"https://api.github.com/repos/tim-evans/ember-sortable/deployments","created_at":"2016-09-02T14:21:54Z","updated_at":"2016-09-02T14:21:55Z","pushed_at":"2016-09-06T21:01:44Z","git_url":"git://github.com/tim-evans/ember-sortable.git","ssh_url":"git@github.com:tim-evans/ember-sortable.git","clone_url":"https://github.com/tim-evans/ember-sortable.git","svn_url":"https://github.com/tim-evans/ember-sortable","homepage":"http://jgwhite.co.uk/ember-sortable/demo","size":2447,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"jgwhite:master","ref":"master","sha":"76c5988bd03fa12d64511ab10928bda495110a88","user":{"login":"jgwhite","id":34030,"avatar_url":"https://avatars.githubusercontent.com/u/34030?v=3","gravatar_id":"","url":"https://api.github.com/users/jgwhite","html_url":"https://github.com/jgwhite","followers_url":"https://api.github.com/users/jgwhite/followers","following_url":"https://api.github.com/users/jgwhite/following{/other_user}","gists_url":"https://api.github.com/users/jgwhite/gists{/gist_id}","starred_url":"https://api.github.com/users/jgwhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgwhite/subscriptions","organizations_url":"https://api.github.com/users/jgwhite/orgs","repos_url":"https://api.github.com/users/jgwhite/repos","events_url":"https://api.github.com/users/jgwhite/events{/privacy}","received_events_url":"https://api.github.com/users/jgwhite/received_events","type":"User","site_admin":false},"repo":{"id":34458322,"name":"ember-sortable","full_name":"jgwhite/ember-sortable","owner":{"login":"jgwhite","id":34030,"avatar_url":"https://avatars.githubusercontent.com/u/34030?v=3","gravatar_id":"","url":"https://api.github.com/users/jgwhite","html_url":"https://github.com/jgwhite","followers_url":"https://api.github.com/users/jgwhite/followers","following_url":"https://api.github.com/users/jgwhite/following{/other_user}","gists_url":"https://api.github.com/users/jgwhite/gists{/gist_id}","starred_url":"https://api.github.com/users/jgwhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgwhite/subscriptions","organizations_url":"https://api.github.com/users/jgwhite/orgs","repos_url":"https://api.github.com/users/jgwhite/repos","events_url":"https://api.github.com/users/jgwhite/events{/privacy}","received_events_url":"https://api.github.com/users/jgwhite/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jgwhite/ember-sortable","description":"Sortable UI primitives for Ember.js","fork":false,"url":"https://api.github.com/repos/jgwhite/ember-sortable","forks_url":"https://api.github.com/repos/jgwhite/ember-sortable/forks","keys_url":"https://api.github.com/repos/jgwhite/ember-sortable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jgwhite/ember-sortable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jgwhite/ember-sortable/teams","hooks_url":"https://api.github.com/repos/jgwhite/ember-sortable/hooks","issue_events_url":"https://api.github.com/repos/jgwhite/ember-sortable/issues/events{/number}","events_url":"https://api.github.com/repos/jgwhite/ember-sortable/events","assignees_url":"https://api.github.com/repos/jgwhite/ember-sortable/assignees{/user}","branches_url":"https://api.github.com/repos/jgwhite/ember-sortable/branches{/branch}","tags_url":"https://api.github.com/repos/jgwhite/ember-sortable/tags","blobs_url":"https://api.github.com/repos/jgwhite/ember-sortable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jgwhite/ember-sortable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jgwhite/ember-sortable/git/refs{/sha}","trees_url":"https://api.github.com/repos/jgwhite/ember-sortable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jgwhite/ember-sortable/statuses/{sha}","languages_url":"https://api.github.com/repos/jgwhite/ember-sortable/languages","stargazers_url":"https://api.github.com/repos/jgwhite/ember-sortable/stargazers","contributors_url":"https://api.github.com/repos/jgwhite/ember-sortable/contributors","subscribers_url":"https://api.github.com/repos/jgwhite/ember-sortable/subscribers","subscription_url":"https://api.github.com/repos/jgwhite/ember-sortable/subscription","commits_url":"https://api.github.com/repos/jgwhite/ember-sortable/commits{/sha}","git_commits_url":"https://api.github.com/repos/jgwhite/ember-sortable/git/commits{/sha}","comments_url":"https://api.github.com/repos/jgwhite/ember-sortable/comments{/number}","issue_comment_url":"https://api.github.com/repos/jgwhite/ember-sortable/issues/comments{/number}","contents_url":"https://api.github.com/repos/jgwhite/ember-sortable/contents/{+path}","compare_url":"https://api.github.com/repos/jgwhite/ember-sortable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jgwhite/ember-sortable/merges","archive_url":"https://api.github.com/repos/jgwhite/ember-sortable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jgwhite/ember-sortable/downloads","issues_url":"https://api.github.com/repos/jgwhite/ember-sortable/issues{/number}","pulls_url":"https://api.github.com/repos/jgwhite/ember-sortable/pulls{/number}","milestones_url":"https://api.github.com/repos/jgwhite/ember-sortable/milestones{/number}","notifications_url":"https://api.github.com/repos/jgwhite/ember-sortable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jgwhite/ember-sortable/labels{/name}","releases_url":"https://api.github.com/repos/jgwhite/ember-sortable/releases{/id}","deployments_url":"https://api.github.com/repos/jgwhite/ember-sortable/deployments","created_at":"2015-04-23T13:36:47Z","updated_at":"2016-09-01T09:24:21Z","pushed_at":"2016-09-06T21:01:44Z","git_url":"git://github.com/jgwhite/ember-sortable.git","ssh_url":"git@github.com:jgwhite/ember-sortable.git","clone_url":"https://github.com/jgwhite/ember-sortable.git","svn_url":"https://github.com/jgwhite/ember-sortable","homepage":"http://jgwhite.co.uk/ember-sortable/demo","size":2490,"stargazers_count":164,"watchers_count":164,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":47,"mirror_url":null,"open_issues_count":20,"forks":47,"open_issues":20,"watchers":164,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/104"},"html":{"href":"https://github.com/jgwhite/ember-sortable/pull/104"},"issue":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/issues/104"},"comments":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/jgwhite/ember-sortable/statuses/c8a32e7a5da07fa4e0d24c05d78bff9dcf40b1ab"}}}}
{"actor":{"display_login":"tim-evans"}}