{"action":"closed","number":26,"pull_request":{"url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls/26","id":62677620,"html_url":"https://github.com/open-craft/jsinput-vectordraw/pull/26","diff_url":"https://github.com/open-craft/jsinput-vectordraw/pull/26.diff","patch_url":"https://github.com/open-craft/jsinput-vectordraw/pull/26.patch","issue_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/issues/26","number":26,"state":"closed","locked":false,"title":"Fix \"Click to draw\" for first object.","user":{"login":"ChristopherChudzicki","id":9010790,"avatar_url":"https://avatars.githubusercontent.com/u/9010790?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristopherChudzicki","html_url":"https://github.com/ChristopherChudzicki","followers_url":"https://api.github.com/users/ChristopherChudzicki/followers","following_url":"https://api.github.com/users/ChristopherChudzicki/following{/other_user}","gists_url":"https://api.github.com/users/ChristopherChudzicki/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristopherChudzicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristopherChudzicki/subscriptions","organizations_url":"https://api.github.com/users/ChristopherChudzicki/orgs","repos_url":"https://api.github.com/users/ChristopherChudzicki/repos","events_url":"https://api.github.com/users/ChristopherChudzicki/events{/privacy}","received_events_url":"https://api.github.com/users/ChristopherChudzicki/received_events","type":"User","site_admin":false},"body":"@dseaton @antoviaque @bradenmacdonald Came across this bug and fixed it while working on JS-Input `vectordraw` problems for MIT. The same bug exists at [line 425](https://github.com/open-craft/xblock-vectordraw/blob/master/vectordraw/public/js/vectordraw.js#L425) of the X-Block version.\r\n\r\nIn recent versions of `vectordraw.js`, clicking on the board would not draw the first object, but would draw for subsequent objects.\r\n\r\nThis seems to have been caused by an `if(selected.idx ...` introduced at 8f68171. I believe this portion of the `if` statement is intended to check that `selected.idx` exists, but fails for the first object whose `idx` value is `0`. \r\n\r\nSee [live example](https://edge.edx.org/courses/course-v1:CAC+CAC101+FOREVER/courseware/054cdf7bdc174cc9a34265988104e657/d1a9e474f6c94473af47d3a989aaf00d/1?activate_block_id=block-v1%3ACAC%2BCAC101%2BFOREVER%2Btype%40vertical%2Bblock%40bc66394cc45c470e854ce96e409202ac).\r\n\r\n(Earlier versions of `vectordraw.js` escaped this bug because `vec_idx = this.element.find('.menu select').val();` was used in the conditional instead and this assignment coerced `idx` to a string). \r\n\r\n--------------------\r\nAlso: I deleted the `!targetObjects` part of the conditional. I am pretty sure `targetObjects` always returns a list, in which case `!targetObjects` is always false. (Even `![]` is false).","created_at":"2016-03-13T17:50:59Z","updated_at":"2016-07-29T20:08:48Z","closed_at":"2016-07-29T20:08:48Z","merged_at":null,"merge_commit_sha":"2c2ec1ee31242b8ddaab974df6e00642695ed48f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls/26/commits","review_comments_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls/26/comments","review_comment_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/issues/26/comments","statuses_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/statuses/65de02ff5d55b5fcf0fcfaef983007e4caa20bcf","head":{"label":"ChristopherChudzicki:master","ref":"master","sha":"65de02ff5d55b5fcf0fcfaef983007e4caa20bcf","user":{"login":"ChristopherChudzicki","id":9010790,"avatar_url":"https://avatars.githubusercontent.com/u/9010790?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristopherChudzicki","html_url":"https://github.com/ChristopherChudzicki","followers_url":"https://api.github.com/users/ChristopherChudzicki/followers","following_url":"https://api.github.com/users/ChristopherChudzicki/following{/other_user}","gists_url":"https://api.github.com/users/ChristopherChudzicki/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristopherChudzicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristopherChudzicki/subscriptions","organizations_url":"https://api.github.com/users/ChristopherChudzicki/orgs","repos_url":"https://api.github.com/users/ChristopherChudzicki/repos","events_url":"https://api.github.com/users/ChristopherChudzicki/events{/privacy}","received_events_url":"https://api.github.com/users/ChristopherChudzicki/received_events","type":"User","site_admin":false},"repo":{"id":40617323,"name":"jsinput-vectordraw","full_name":"ChristopherChudzicki/jsinput-vectordraw","owner":{"login":"ChristopherChudzicki","id":9010790,"avatar_url":"https://avatars.githubusercontent.com/u/9010790?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristopherChudzicki","html_url":"https://github.com/ChristopherChudzicki","followers_url":"https://api.github.com/users/ChristopherChudzicki/followers","following_url":"https://api.github.com/users/ChristopherChudzicki/following{/other_user}","gists_url":"https://api.github.com/users/ChristopherChudzicki/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristopherChudzicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristopherChudzicki/subscriptions","organizations_url":"https://api.github.com/users/ChristopherChudzicki/orgs","repos_url":"https://api.github.com/users/ChristopherChudzicki/repos","events_url":"https://api.github.com/users/ChristopherChudzicki/events{/privacy}","received_events_url":"https://api.github.com/users/ChristopherChudzicki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ChristopherChudzicki/jsinput-vectordraw","description":"Vector drawing exercises with JSInput","fork":true,"url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw","forks_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/forks","keys_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/teams","hooks_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/hooks","issue_events_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/issues/events{/number}","events_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/events","assignees_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/assignees{/user}","branches_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/branches{/branch}","tags_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/tags","blobs_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/statuses/{sha}","languages_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/languages","stargazers_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/stargazers","contributors_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/contributors","subscribers_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/subscribers","subscription_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/subscription","commits_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/contents/{+path}","compare_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/merges","archive_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/downloads","issues_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/issues{/number}","pulls_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/pulls{/number}","milestones_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/milestones{/number}","notifications_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/labels{/name}","releases_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/releases{/id}","deployments_url":"https://api.github.com/repos/ChristopherChudzicki/jsinput-vectordraw/deployments","created_at":"2015-08-12T18:27:49Z","updated_at":"2016-03-13T17:46:15Z","pushed_at":"2016-07-29T20:08:48Z","git_url":"git://github.com/ChristopherChudzicki/jsinput-vectordraw.git","ssh_url":"git@github.com:ChristopherChudzicki/jsinput-vectordraw.git","clone_url":"https://github.com/ChristopherChudzicki/jsinput-vectordraw.git","svn_url":"https://github.com/ChristopherChudzicki/jsinput-vectordraw","homepage":null,"size":5482,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"open-craft:master","ref":"master","sha":"65de02ff5d55b5fcf0fcfaef983007e4caa20bcf","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":29481629,"name":"jsinput-vectordraw","full_name":"open-craft/jsinput-vectordraw","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/jsinput-vectordraw","description":"Vector drawing exercises with JSInput","fork":false,"url":"https://api.github.com/repos/open-craft/jsinput-vectordraw","forks_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/forks","keys_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/teams","hooks_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/hooks","issue_events_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/events","assignees_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/tags","blobs_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/languages","stargazers_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/stargazers","contributors_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/contributors","subscribers_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/subscribers","subscription_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/subscription","commits_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/merges","archive_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/downloads","issues_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/releases{/id}","deployments_url":"https://api.github.com/repos/open-craft/jsinput-vectordraw/deployments","created_at":"2015-01-19T17:06:20Z","updated_at":"2015-12-20T02:31:20Z","pushed_at":"2016-03-14T16:03:27Z","git_url":"git://github.com/open-craft/jsinput-vectordraw.git","ssh_url":"git@github.com:open-craft/jsinput-vectordraw.git","clone_url":"https://github.com/open-craft/jsinput-vectordraw.git","svn_url":"https://github.com/open-craft/jsinput-vectordraw","homepage":null,"size":5759,"stargazers_count":3,"watchers_count":3,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls/26"},"html":{"href":"https://github.com/open-craft/jsinput-vectordraw/pull/26"},"issue":{"href":"https://api.github.com/repos/open-craft/jsinput-vectordraw/issues/26"},"comments":{"href":"https://api.github.com/repos/open-craft/jsinput-vectordraw/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-craft/jsinput-vectordraw/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/open-craft/jsinput-vectordraw/statuses/65de02ff5d55b5fcf0fcfaef983007e4caa20bcf"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":1,"review_comments":0,"commits":0,"additions":0,"deletions":0,"changed_files":0}}
{"actor":{"display_login":"ChristopherChudzicki"}}