{"action":"created","comment":{"url":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/comments/74299314","id":74299314,"diff_hunk":"@@ -271,35 +271,39 @@ export class VirtualRepeat extends AbstractRepeater {\n   _getMore(): void {\n     if (this.isLastIndex || this._first === 0) {\n       if (!this._calledGetMore) {\n-        let getMoreFuncName = this.view(0).firstChild.getAttribute('virtual-repeat-next');\n-        if (!getMoreFuncName) {\n-          return;\n-        }\n-        let getMoreFuncParts = getMoreFuncName.split('.');\n-        let getMoreFunc = this.scope.overrideContext.bindingContext || {};\n-        for (let propertyIndex = 0; propertyIndex < getMoreFuncParts.length; propertyIndex++) {\n-          getMoreFunc = getMoreFunc[getMoreFuncParts[propertyIndex]];\n-          if (!getMoreFunc) {\n-            throw new Error(\"Can't locate 'virtual-repeat-next' function\");\n-          }\n-        }\n         let executeGetMore = () => {\n           this._calledGetMore = true;\n-          if (getMoreFunc instanceof Promise) {\n-            return getMoreFunc.then(() => {\n-              this._calledGetMore = false; //Reset for the next time\n-            });\n-          } else if (typeof getMoreFunc === 'function') {\n-            let result = getMoreFunc.bind(this.scope.overrideContext.bindingContext)(this._first, this._bottomBufferHeight === 0, this._isAtTop);\n-            if (!(result instanceof Promise)) {\n-              this._calledGetMore = false; //Reset for the next time\n-            } else {\n-              return result.then(() => {\n+          let func = this.view(0).firstChild.au['virtual-repeat-next'].instruction.attributes['virtual-repeat-next'];\n+          let topIndex = this._first;\n+          let isAtBottom = this._bottomBufferHeight === 0;\n+          let isAtTop = this._isAtTop;\n+\n+          this.scope.overrideContext.topIndex = topIndex;\n+          this.scope.overrideContext.isAtBottom = isAtBottom;\n+          this.scope.overrideContext.isAtTop = isAtTop;\n+\n+          if (typeof func === 'string') {\n+            let getMoreFuncName = this.view(0).firstChild.getAttribute('virtual-repeat-next');\n+            let funcCall = this.scope.overrideContext.bindingContext[getMoreFuncName];\n+\n+            if (funcCall instanceof Promise) {","path":"src/virtual-repeat.js","position":34,"original_position":41,"commit_id":"81d4934df1ffc5dabb1f121716aa08d2cdb451e6","original_commit_id":"81d4934df1ffc5dabb1f121716aa08d2cdb451e6","user":{"login":"CasiOo","id":5333676,"avatar_url":"https://avatars.githubusercontent.com/u/5333676?v=3","gravatar_id":"","url":"https://api.github.com/users/CasiOo","html_url":"https://github.com/CasiOo","followers_url":"https://api.github.com/users/CasiOo/followers","following_url":"https://api.github.com/users/CasiOo/following{/other_user}","gists_url":"https://api.github.com/users/CasiOo/gists{/gist_id}","starred_url":"https://api.github.com/users/CasiOo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CasiOo/subscriptions","organizations_url":"https://api.github.com/users/CasiOo/orgs","repos_url":"https://api.github.com/users/CasiOo/repos","events_url":"https://api.github.com/users/CasiOo/events{/privacy}","received_events_url":"https://api.github.com/users/CasiOo/received_events","type":"User","site_admin":false},"body":"How does that work with a promise? I thought only function calls were to be supported.","created_at":"2016-08-10T18:12:46Z","updated_at":"2016-08-10T18:12:46Z","html_url":"https://github.com/aurelia/ui-virtualization/pull/72#discussion_r74299314","pull_request_url":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/comments/74299314"},"html":{"href":"https://github.com/aurelia/ui-virtualization/pull/72#discussion_r74299314"},"pull_request":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/72","id":77629206,"html_url":"https://github.com/aurelia/ui-virtualization/pull/72","diff_url":"https://github.com/aurelia/ui-virtualization/pull/72.diff","patch_url":"https://github.com/aurelia/ui-virtualization/pull/72.patch","issue_url":"https://api.github.com/repos/aurelia/ui-virtualization/issues/72","number":72,"state":"open","locked":false,"title":"feat(virtual-repeat): allow 'next' function defined from sub properties","user":{"login":"AStoker","id":2907279,"avatar_url":"https://avatars.githubusercontent.com/u/2907279?v=3","gravatar_id":"","url":"https://api.github.com/users/AStoker","html_url":"https://github.com/AStoker","followers_url":"https://api.github.com/users/AStoker/followers","following_url":"https://api.github.com/users/AStoker/following{/other_user}","gists_url":"https://api.github.com/users/AStoker/gists{/gist_id}","starred_url":"https://api.github.com/users/AStoker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AStoker/subscriptions","organizations_url":"https://api.github.com/users/AStoker/orgs","repos_url":"https://api.github.com/users/AStoker/repos","events_url":"https://api.github.com/users/AStoker/events{/privacy}","received_events_url":"https://api.github.com/users/AStoker/received_events","type":"User","site_admin":false},"body":"Allow ‘virtual-repeat-next' function to allow sub properties, i.e.\r\n`virtual-repeat-next=“foo.bar.getNext”`\r\n\r\nFixes an issue where if you were using `virtual-repeat` inside a custom element, and your function for getting more existed on the parent, you couldn't directly reference the function.\r\nExample:\r\nPreviously broken due to inability to parse `$parent.getMore`\r\n``` html\r\n<li virtual-repeat.for='item of items' virtual-repeat-next='$parent.getMore'>${item}</li>\r\n```\r\nNow fixed. Same syntax, but can parse the bindable property to find the correct function.\r\n``` html\r\n<li virtual-repeat.for='item of items' virtual-repeat-next='$parent.getMore'>${item}</li>\r\n```","created_at":"2016-07-15T14:58:43Z","updated_at":"2016-08-10T18:12:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3e01bad9ac432c3cd3e9ecf8d43a8b827dba71f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/72/commits","review_comments_url":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/72/comments","review_comment_url":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aurelia/ui-virtualization/issues/72/comments","statuses_url":"https://api.github.com/repos/aurelia/ui-virtualization/statuses/81d4934df1ffc5dabb1f121716aa08d2cdb451e6","head":{"label":"AStoker:infinite-scroll-2","ref":"infinite-scroll-2","sha":"81d4934df1ffc5dabb1f121716aa08d2cdb451e6","user":{"login":"AStoker","id":2907279,"avatar_url":"https://avatars.githubusercontent.com/u/2907279?v=3","gravatar_id":"","url":"https://api.github.com/users/AStoker","html_url":"https://github.com/AStoker","followers_url":"https://api.github.com/users/AStoker/followers","following_url":"https://api.github.com/users/AStoker/following{/other_user}","gists_url":"https://api.github.com/users/AStoker/gists{/gist_id}","starred_url":"https://api.github.com/users/AStoker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AStoker/subscriptions","organizations_url":"https://api.github.com/users/AStoker/orgs","repos_url":"https://api.github.com/users/AStoker/repos","events_url":"https://api.github.com/users/AStoker/events{/privacy}","received_events_url":"https://api.github.com/users/AStoker/received_events","type":"User","site_admin":false},"repo":{"id":61635783,"name":"ui-virtualization","full_name":"AStoker/ui-virtualization","owner":{"login":"AStoker","id":2907279,"avatar_url":"https://avatars.githubusercontent.com/u/2907279?v=3","gravatar_id":"","url":"https://api.github.com/users/AStoker","html_url":"https://github.com/AStoker","followers_url":"https://api.github.com/users/AStoker/followers","following_url":"https://api.github.com/users/AStoker/following{/other_user}","gists_url":"https://api.github.com/users/AStoker/gists{/gist_id}","starred_url":"https://api.github.com/users/AStoker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AStoker/subscriptions","organizations_url":"https://api.github.com/users/AStoker/orgs","repos_url":"https://api.github.com/users/AStoker/repos","events_url":"https://api.github.com/users/AStoker/events{/privacy}","received_events_url":"https://api.github.com/users/AStoker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AStoker/ui-virtualization","description":"A plugin that provides a virtualized repeater and other virtualization services.","fork":true,"url":"https://api.github.com/repos/AStoker/ui-virtualization","forks_url":"https://api.github.com/repos/AStoker/ui-virtualization/forks","keys_url":"https://api.github.com/repos/AStoker/ui-virtualization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AStoker/ui-virtualization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AStoker/ui-virtualization/teams","hooks_url":"https://api.github.com/repos/AStoker/ui-virtualization/hooks","issue_events_url":"https://api.github.com/repos/AStoker/ui-virtualization/issues/events{/number}","events_url":"https://api.github.com/repos/AStoker/ui-virtualization/events","assignees_url":"https://api.github.com/repos/AStoker/ui-virtualization/assignees{/user}","branches_url":"https://api.github.com/repos/AStoker/ui-virtualization/branches{/branch}","tags_url":"https://api.github.com/repos/AStoker/ui-virtualization/tags","blobs_url":"https://api.github.com/repos/AStoker/ui-virtualization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AStoker/ui-virtualization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AStoker/ui-virtualization/git/refs{/sha}","trees_url":"https://api.github.com/repos/AStoker/ui-virtualization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AStoker/ui-virtualization/statuses/{sha}","languages_url":"https://api.github.com/repos/AStoker/ui-virtualization/languages","stargazers_url":"https://api.github.com/repos/AStoker/ui-virtualization/stargazers","contributors_url":"https://api.github.com/repos/AStoker/ui-virtualization/contributors","subscribers_url":"https://api.github.com/repos/AStoker/ui-virtualization/subscribers","subscription_url":"https://api.github.com/repos/AStoker/ui-virtualization/subscription","commits_url":"https://api.github.com/repos/AStoker/ui-virtualization/commits{/sha}","git_commits_url":"https://api.github.com/repos/AStoker/ui-virtualization/git/commits{/sha}","comments_url":"https://api.github.com/repos/AStoker/ui-virtualization/comments{/number}","issue_comment_url":"https://api.github.com/repos/AStoker/ui-virtualization/issues/comments{/number}","contents_url":"https://api.github.com/repos/AStoker/ui-virtualization/contents/{+path}","compare_url":"https://api.github.com/repos/AStoker/ui-virtualization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AStoker/ui-virtualization/merges","archive_url":"https://api.github.com/repos/AStoker/ui-virtualization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AStoker/ui-virtualization/downloads","issues_url":"https://api.github.com/repos/AStoker/ui-virtualization/issues{/number}","pulls_url":"https://api.github.com/repos/AStoker/ui-virtualization/pulls{/number}","milestones_url":"https://api.github.com/repos/AStoker/ui-virtualization/milestones{/number}","notifications_url":"https://api.github.com/repos/AStoker/ui-virtualization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AStoker/ui-virtualization/labels{/name}","releases_url":"https://api.github.com/repos/AStoker/ui-virtualization/releases{/id}","deployments_url":"https://api.github.com/repos/AStoker/ui-virtualization/deployments","created_at":"2016-06-21T13:25:35Z","updated_at":"2016-06-21T13:25:37Z","pushed_at":"2016-08-10T16:04:37Z","git_url":"git://github.com/AStoker/ui-virtualization.git","ssh_url":"git@github.com:AStoker/ui-virtualization.git","clone_url":"https://github.com/AStoker/ui-virtualization.git","svn_url":"https://github.com/AStoker/ui-virtualization","homepage":null,"size":1322,"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":"aurelia:master","ref":"master","sha":"66d7418a8415a2396741d441e0144722c748daa4","user":{"login":"aurelia","id":9808864,"avatar_url":"https://avatars.githubusercontent.com/u/9808864?v=3","gravatar_id":"","url":"https://api.github.com/users/aurelia","html_url":"https://github.com/aurelia","followers_url":"https://api.github.com/users/aurelia/followers","following_url":"https://api.github.com/users/aurelia/following{/other_user}","gists_url":"https://api.github.com/users/aurelia/gists{/gist_id}","starred_url":"https://api.github.com/users/aurelia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aurelia/subscriptions","organizations_url":"https://api.github.com/users/aurelia/orgs","repos_url":"https://api.github.com/users/aurelia/repos","events_url":"https://api.github.com/users/aurelia/events{/privacy}","received_events_url":"https://api.github.com/users/aurelia/received_events","type":"Organization","site_admin":false},"repo":{"id":38145064,"name":"ui-virtualization","full_name":"aurelia/ui-virtualization","owner":{"login":"aurelia","id":9808864,"avatar_url":"https://avatars.githubusercontent.com/u/9808864?v=3","gravatar_id":"","url":"https://api.github.com/users/aurelia","html_url":"https://github.com/aurelia","followers_url":"https://api.github.com/users/aurelia/followers","following_url":"https://api.github.com/users/aurelia/following{/other_user}","gists_url":"https://api.github.com/users/aurelia/gists{/gist_id}","starred_url":"https://api.github.com/users/aurelia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aurelia/subscriptions","organizations_url":"https://api.github.com/users/aurelia/orgs","repos_url":"https://api.github.com/users/aurelia/repos","events_url":"https://api.github.com/users/aurelia/events{/privacy}","received_events_url":"https://api.github.com/users/aurelia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aurelia/ui-virtualization","description":"A plugin that provides a virtualized repeater and other virtualization services.","fork":false,"url":"https://api.github.com/repos/aurelia/ui-virtualization","forks_url":"https://api.github.com/repos/aurelia/ui-virtualization/forks","keys_url":"https://api.github.com/repos/aurelia/ui-virtualization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aurelia/ui-virtualization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aurelia/ui-virtualization/teams","hooks_url":"https://api.github.com/repos/aurelia/ui-virtualization/hooks","issue_events_url":"https://api.github.com/repos/aurelia/ui-virtualization/issues/events{/number}","events_url":"https://api.github.com/repos/aurelia/ui-virtualization/events","assignees_url":"https://api.github.com/repos/aurelia/ui-virtualization/assignees{/user}","branches_url":"https://api.github.com/repos/aurelia/ui-virtualization/branches{/branch}","tags_url":"https://api.github.com/repos/aurelia/ui-virtualization/tags","blobs_url":"https://api.github.com/repos/aurelia/ui-virtualization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aurelia/ui-virtualization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aurelia/ui-virtualization/git/refs{/sha}","trees_url":"https://api.github.com/repos/aurelia/ui-virtualization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aurelia/ui-virtualization/statuses/{sha}","languages_url":"https://api.github.com/repos/aurelia/ui-virtualization/languages","stargazers_url":"https://api.github.com/repos/aurelia/ui-virtualization/stargazers","contributors_url":"https://api.github.com/repos/aurelia/ui-virtualization/contributors","subscribers_url":"https://api.github.com/repos/aurelia/ui-virtualization/subscribers","subscription_url":"https://api.github.com/repos/aurelia/ui-virtualization/subscription","commits_url":"https://api.github.com/repos/aurelia/ui-virtualization/commits{/sha}","git_commits_url":"https://api.github.com/repos/aurelia/ui-virtualization/git/commits{/sha}","comments_url":"https://api.github.com/repos/aurelia/ui-virtualization/comments{/number}","issue_comment_url":"https://api.github.com/repos/aurelia/ui-virtualization/issues/comments{/number}","contents_url":"https://api.github.com/repos/aurelia/ui-virtualization/contents/{+path}","compare_url":"https://api.github.com/repos/aurelia/ui-virtualization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aurelia/ui-virtualization/merges","archive_url":"https://api.github.com/repos/aurelia/ui-virtualization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aurelia/ui-virtualization/downloads","issues_url":"https://api.github.com/repos/aurelia/ui-virtualization/issues{/number}","pulls_url":"https://api.github.com/repos/aurelia/ui-virtualization/pulls{/number}","milestones_url":"https://api.github.com/repos/aurelia/ui-virtualization/milestones{/number}","notifications_url":"https://api.github.com/repos/aurelia/ui-virtualization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aurelia/ui-virtualization/labels{/name}","releases_url":"https://api.github.com/repos/aurelia/ui-virtualization/releases{/id}","deployments_url":"https://api.github.com/repos/aurelia/ui-virtualization/deployments","created_at":"2015-06-27T03:23:52Z","updated_at":"2016-08-06T03:31:24Z","pushed_at":"2016-08-10T15:54:13Z","git_url":"git://github.com/aurelia/ui-virtualization.git","ssh_url":"git@github.com:aurelia/ui-virtualization.git","clone_url":"https://github.com/aurelia/ui-virtualization.git","svn_url":"https://github.com/aurelia/ui-virtualization","homepage":null,"size":1288,"stargazers_count":54,"watchers_count":54,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"open_issues_count":14,"forks":19,"open_issues":14,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/72"},"html":{"href":"https://github.com/aurelia/ui-virtualization/pull/72"},"issue":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/issues/72"},"comments":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/aurelia/ui-virtualization/statuses/81d4934df1ffc5dabb1f121716aa08d2cdb451e6"}}}}
{"actor":{"display_login":"CasiOo"}}