{"action":"created","comment":{"url":"https://api.github.com/repos/kokorigami/viewer/pulls/comments/62797813","id":62797813,"diff_hunk":"@@ -6,19 +6,59 @@ var Viewer = function (el) {\n   this.el.classList.add('kokorigami-viewer');\n   this._ = {\n     model: new Model(),\n-    progress: 0,\n+    frame: 0,\n     renderer: new Renderer(this.el)\n   };\n   return this;\n };\n \n Viewer.prototype = {};\n \n+Viewer.prototype.render = function () {\n+  this._.renderer.play();\n+};\n+\n+Viewer.prototype.play = function (frame) {\n+  if (this.raf) cancelAnimationFrame(this.raf);","path":"src/viewer.js","position":18,"original_position":18,"commit_id":"68d9ba3cea01eebe9fa12399a92b8e314d8c63b6","original_commit_id":"68d9ba3cea01eebe9fa12399a92b8e314d8c63b6","user":{"login":"cixzhang","id":2781099,"avatar_url":"https://avatars.githubusercontent.com/u/2781099?v=3","gravatar_id":"","url":"https://api.github.com/users/cixzhang","html_url":"https://github.com/cixzhang","followers_url":"https://api.github.com/users/cixzhang/followers","following_url":"https://api.github.com/users/cixzhang/following{/other_user}","gists_url":"https://api.github.com/users/cixzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/cixzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cixzhang/subscriptions","organizations_url":"https://api.github.com/users/cixzhang/orgs","repos_url":"https://api.github.com/users/cixzhang/repos","events_url":"https://api.github.com/users/cixzhang/events{/privacy}","received_events_url":"https://api.github.com/users/cixzhang/received_events","type":"User","site_admin":false},"body":"Viewer now tracks the animation frame and cancels it when play is called in the middle of an existing animation, so this should solve the issues around invoking play functions multiple times.","created_at":"2016-05-11T06:38:39Z","updated_at":"2016-05-11T06:38:39Z","html_url":"https://github.com/kokorigami/viewer/pull/10#discussion_r62797813","pull_request_url":"https://api.github.com/repos/kokorigami/viewer/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/kokorigami/viewer/pulls/comments/62797813"},"html":{"href":"https://github.com/kokorigami/viewer/pull/10#discussion_r62797813"},"pull_request":{"href":"https://api.github.com/repos/kokorigami/viewer/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/kokorigami/viewer/pulls/10","id":69449801,"html_url":"https://github.com/kokorigami/viewer/pull/10","diff_url":"https://github.com/kokorigami/viewer/pull/10.diff","patch_url":"https://github.com/kokorigami/viewer/pull/10.patch","issue_url":"https://api.github.com/repos/kokorigami/viewer/issues/10","number":10,"state":"open","locked":false,"title":"Steps","user":{"login":"cixzhang","id":2781099,"avatar_url":"https://avatars.githubusercontent.com/u/2781099?v=3","gravatar_id":"","url":"https://api.github.com/users/cixzhang","html_url":"https://github.com/cixzhang","followers_url":"https://api.github.com/users/cixzhang/followers","following_url":"https://api.github.com/users/cixzhang/following{/other_user}","gists_url":"https://api.github.com/users/cixzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/cixzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cixzhang/subscriptions","organizations_url":"https://api.github.com/users/cixzhang/orgs","repos_url":"https://api.github.com/users/cixzhang/repos","events_url":"https://api.github.com/users/cixzhang/events{/privacy}","received_events_url":"https://api.github.com/users/cixzhang/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-10T05:11:31Z","updated_at":"2016-05-11T06:38:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de4ce36822c11ed340f45343d2068bfaf7fa4831","assignee":{"login":"ptpham","id":304359,"avatar_url":"https://avatars.githubusercontent.com/u/304359?v=3","gravatar_id":"","url":"https://api.github.com/users/ptpham","html_url":"https://github.com/ptpham","followers_url":"https://api.github.com/users/ptpham/followers","following_url":"https://api.github.com/users/ptpham/following{/other_user}","gists_url":"https://api.github.com/users/ptpham/gists{/gist_id}","starred_url":"https://api.github.com/users/ptpham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptpham/subscriptions","organizations_url":"https://api.github.com/users/ptpham/orgs","repos_url":"https://api.github.com/users/ptpham/repos","events_url":"https://api.github.com/users/ptpham/events{/privacy}","received_events_url":"https://api.github.com/users/ptpham/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kokorigami/viewer/pulls/10/commits","review_comments_url":"https://api.github.com/repos/kokorigami/viewer/pulls/10/comments","review_comment_url":"https://api.github.com/repos/kokorigami/viewer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kokorigami/viewer/issues/10/comments","statuses_url":"https://api.github.com/repos/kokorigami/viewer/statuses/68d9ba3cea01eebe9fa12399a92b8e314d8c63b6","head":{"label":"kokorigami:steps","ref":"steps","sha":"68d9ba3cea01eebe9fa12399a92b8e314d8c63b6","user":{"login":"kokorigami","id":16181110,"avatar_url":"https://avatars.githubusercontent.com/u/16181110?v=3","gravatar_id":"","url":"https://api.github.com/users/kokorigami","html_url":"https://github.com/kokorigami","followers_url":"https://api.github.com/users/kokorigami/followers","following_url":"https://api.github.com/users/kokorigami/following{/other_user}","gists_url":"https://api.github.com/users/kokorigami/gists{/gist_id}","starred_url":"https://api.github.com/users/kokorigami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokorigami/subscriptions","organizations_url":"https://api.github.com/users/kokorigami/orgs","repos_url":"https://api.github.com/users/kokorigami/repos","events_url":"https://api.github.com/users/kokorigami/events{/privacy}","received_events_url":"https://api.github.com/users/kokorigami/received_events","type":"Organization","site_admin":false},"repo":{"id":47517205,"name":"viewer","full_name":"kokorigami/viewer","owner":{"login":"kokorigami","id":16181110,"avatar_url":"https://avatars.githubusercontent.com/u/16181110?v=3","gravatar_id":"","url":"https://api.github.com/users/kokorigami","html_url":"https://github.com/kokorigami","followers_url":"https://api.github.com/users/kokorigami/followers","following_url":"https://api.github.com/users/kokorigami/following{/other_user}","gists_url":"https://api.github.com/users/kokorigami/gists{/gist_id}","starred_url":"https://api.github.com/users/kokorigami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokorigami/subscriptions","organizations_url":"https://api.github.com/users/kokorigami/orgs","repos_url":"https://api.github.com/users/kokorigami/repos","events_url":"https://api.github.com/users/kokorigami/events{/privacy}","received_events_url":"https://api.github.com/users/kokorigami/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kokorigami/viewer","description":"Origami viewer for kokorigami.","fork":false,"url":"https://api.github.com/repos/kokorigami/viewer","forks_url":"https://api.github.com/repos/kokorigami/viewer/forks","keys_url":"https://api.github.com/repos/kokorigami/viewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kokorigami/viewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kokorigami/viewer/teams","hooks_url":"https://api.github.com/repos/kokorigami/viewer/hooks","issue_events_url":"https://api.github.com/repos/kokorigami/viewer/issues/events{/number}","events_url":"https://api.github.com/repos/kokorigami/viewer/events","assignees_url":"https://api.github.com/repos/kokorigami/viewer/assignees{/user}","branches_url":"https://api.github.com/repos/kokorigami/viewer/branches{/branch}","tags_url":"https://api.github.com/repos/kokorigami/viewer/tags","blobs_url":"https://api.github.com/repos/kokorigami/viewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kokorigami/viewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kokorigami/viewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/kokorigami/viewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kokorigami/viewer/statuses/{sha}","languages_url":"https://api.github.com/repos/kokorigami/viewer/languages","stargazers_url":"https://api.github.com/repos/kokorigami/viewer/stargazers","contributors_url":"https://api.github.com/repos/kokorigami/viewer/contributors","subscribers_url":"https://api.github.com/repos/kokorigami/viewer/subscribers","subscription_url":"https://api.github.com/repos/kokorigami/viewer/subscription","commits_url":"https://api.github.com/repos/kokorigami/viewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/kokorigami/viewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/kokorigami/viewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/kokorigami/viewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/kokorigami/viewer/contents/{+path}","compare_url":"https://api.github.com/repos/kokorigami/viewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kokorigami/viewer/merges","archive_url":"https://api.github.com/repos/kokorigami/viewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kokorigami/viewer/downloads","issues_url":"https://api.github.com/repos/kokorigami/viewer/issues{/number}","pulls_url":"https://api.github.com/repos/kokorigami/viewer/pulls{/number}","milestones_url":"https://api.github.com/repos/kokorigami/viewer/milestones{/number}","notifications_url":"https://api.github.com/repos/kokorigami/viewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kokorigami/viewer/labels{/name}","releases_url":"https://api.github.com/repos/kokorigami/viewer/releases{/id}","deployments_url":"https://api.github.com/repos/kokorigami/viewer/deployments","created_at":"2015-12-06T22:51:01Z","updated_at":"2016-01-24T03:54:53Z","pushed_at":"2016-05-11T06:35:08Z","git_url":"git://github.com/kokorigami/viewer.git","ssh_url":"git@github.com:kokorigami/viewer.git","clone_url":"https://github.com/kokorigami/viewer.git","svn_url":"https://github.com/kokorigami/viewer","homepage":null,"size":332,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"kokorigami:master","ref":"master","sha":"256d76e945dce9e6c388e77b0ef9237209202ed9","user":{"login":"kokorigami","id":16181110,"avatar_url":"https://avatars.githubusercontent.com/u/16181110?v=3","gravatar_id":"","url":"https://api.github.com/users/kokorigami","html_url":"https://github.com/kokorigami","followers_url":"https://api.github.com/users/kokorigami/followers","following_url":"https://api.github.com/users/kokorigami/following{/other_user}","gists_url":"https://api.github.com/users/kokorigami/gists{/gist_id}","starred_url":"https://api.github.com/users/kokorigami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokorigami/subscriptions","organizations_url":"https://api.github.com/users/kokorigami/orgs","repos_url":"https://api.github.com/users/kokorigami/repos","events_url":"https://api.github.com/users/kokorigami/events{/privacy}","received_events_url":"https://api.github.com/users/kokorigami/received_events","type":"Organization","site_admin":false},"repo":{"id":47517205,"name":"viewer","full_name":"kokorigami/viewer","owner":{"login":"kokorigami","id":16181110,"avatar_url":"https://avatars.githubusercontent.com/u/16181110?v=3","gravatar_id":"","url":"https://api.github.com/users/kokorigami","html_url":"https://github.com/kokorigami","followers_url":"https://api.github.com/users/kokorigami/followers","following_url":"https://api.github.com/users/kokorigami/following{/other_user}","gists_url":"https://api.github.com/users/kokorigami/gists{/gist_id}","starred_url":"https://api.github.com/users/kokorigami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokorigami/subscriptions","organizations_url":"https://api.github.com/users/kokorigami/orgs","repos_url":"https://api.github.com/users/kokorigami/repos","events_url":"https://api.github.com/users/kokorigami/events{/privacy}","received_events_url":"https://api.github.com/users/kokorigami/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kokorigami/viewer","description":"Origami viewer for kokorigami.","fork":false,"url":"https://api.github.com/repos/kokorigami/viewer","forks_url":"https://api.github.com/repos/kokorigami/viewer/forks","keys_url":"https://api.github.com/repos/kokorigami/viewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kokorigami/viewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kokorigami/viewer/teams","hooks_url":"https://api.github.com/repos/kokorigami/viewer/hooks","issue_events_url":"https://api.github.com/repos/kokorigami/viewer/issues/events{/number}","events_url":"https://api.github.com/repos/kokorigami/viewer/events","assignees_url":"https://api.github.com/repos/kokorigami/viewer/assignees{/user}","branches_url":"https://api.github.com/repos/kokorigami/viewer/branches{/branch}","tags_url":"https://api.github.com/repos/kokorigami/viewer/tags","blobs_url":"https://api.github.com/repos/kokorigami/viewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kokorigami/viewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kokorigami/viewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/kokorigami/viewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kokorigami/viewer/statuses/{sha}","languages_url":"https://api.github.com/repos/kokorigami/viewer/languages","stargazers_url":"https://api.github.com/repos/kokorigami/viewer/stargazers","contributors_url":"https://api.github.com/repos/kokorigami/viewer/contributors","subscribers_url":"https://api.github.com/repos/kokorigami/viewer/subscribers","subscription_url":"https://api.github.com/repos/kokorigami/viewer/subscription","commits_url":"https://api.github.com/repos/kokorigami/viewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/kokorigami/viewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/kokorigami/viewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/kokorigami/viewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/kokorigami/viewer/contents/{+path}","compare_url":"https://api.github.com/repos/kokorigami/viewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kokorigami/viewer/merges","archive_url":"https://api.github.com/repos/kokorigami/viewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kokorigami/viewer/downloads","issues_url":"https://api.github.com/repos/kokorigami/viewer/issues{/number}","pulls_url":"https://api.github.com/repos/kokorigami/viewer/pulls{/number}","milestones_url":"https://api.github.com/repos/kokorigami/viewer/milestones{/number}","notifications_url":"https://api.github.com/repos/kokorigami/viewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kokorigami/viewer/labels{/name}","releases_url":"https://api.github.com/repos/kokorigami/viewer/releases{/id}","deployments_url":"https://api.github.com/repos/kokorigami/viewer/deployments","created_at":"2015-12-06T22:51:01Z","updated_at":"2016-01-24T03:54:53Z","pushed_at":"2016-05-11T06:35:08Z","git_url":"git://github.com/kokorigami/viewer.git","ssh_url":"git@github.com:kokorigami/viewer.git","clone_url":"https://github.com/kokorigami/viewer.git","svn_url":"https://github.com/kokorigami/viewer","homepage":null,"size":332,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kokorigami/viewer/pulls/10"},"html":{"href":"https://github.com/kokorigami/viewer/pull/10"},"issue":{"href":"https://api.github.com/repos/kokorigami/viewer/issues/10"},"comments":{"href":"https://api.github.com/repos/kokorigami/viewer/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/kokorigami/viewer/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/kokorigami/viewer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kokorigami/viewer/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/kokorigami/viewer/statuses/68d9ba3cea01eebe9fa12399a92b8e314d8c63b6"}}}}