{"action":"created","comment":{"url":"https://api.github.com/repos/binary-com/SmartCharts/pulls/comments/208525685","pull_request_review_id":144350146,"id":208525685,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODUyNTY4NQ==","diff_hunk":"@@ -0,0 +1,51 @@\n+import { action, observable, when } from 'mobx';\n+\n+export default class DrawingCursorStore {\n+    constructor(mainStore) {\n+        this.mainStore = mainStore;\n+        when(() => this.context, this.onContextReady);\n+    }\n+\n+    get context() { return this.mainStore.chart.context; }\n+    get stx() { return this.context.stx; }\n+\n+    @observable isDrawing;\n+    @observable top;\n+    @observable left;\n+    @observable display;\n+\n+    onContextReady = () => {\n+        this.stx.container.addEventListener('mousemove', this.onMouseMove);\n+        this.stx.container.addEventListener('touchmove', this.onMouseMove);\n+        this.stx.container.addEventListener('touchend', this.onTouchEnd);\n+    };\n+\n+    @action.bound onMouseMove = (e) => {\n+        e.preventDefault();\n+        this.isDrawing = this.stx.currentVectorParameters.vectorType;\n+        const crosshairX = this.stx.container.getElementsByClassName('stx_crosshair_x')[0];\n+        const crosshairY = this.stx.container.getElementsByClassName('stx_crosshair_y')[0];\n+\n+        if (this.isDrawing) {\n+            this.display = 'block';\n+            this.left = `${crosshairX.offsetLeft}px`;\n+            this.top = `${crosshairY.offsetTop - 16}px`;\n+        } else {\n+            this.display = 'none';\n+        }\n+    }\n+\n+    @action.bound onTouchEnd = (e) => {\n+        e.preventDefault();\n+        setTimeout(() => {","path":"src/store/DrawingCursorStore.js","position":40,"original_position":40,"commit_id":"fe401305ad4e9016bcd512332a236ad8b78b97ee","original_commit_id":"fe401305ad4e9016bcd512332a236ad8b78b97ee","user":{"login":"MahboobehMohammadi","id":3080372,"node_id":"MDQ6VXNlcjMwODAzNzI=","avatar_url":"https://avatars3.githubusercontent.com/u/3080372?v=4","gravatar_id":"","url":"https://api.github.com/users/MahboobehMohammadi","html_url":"https://github.com/MahboobehMohammadi","followers_url":"https://api.github.com/users/MahboobehMohammadi/followers","following_url":"https://api.github.com/users/MahboobehMohammadi/following{/other_user}","gists_url":"https://api.github.com/users/MahboobehMohammadi/gists{/gist_id}","starred_url":"https://api.github.com/users/MahboobehMohammadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MahboobehMohammadi/subscriptions","organizations_url":"https://api.github.com/users/MahboobehMohammadi/orgs","repos_url":"https://api.github.com/users/MahboobehMohammadi/repos","events_url":"https://api.github.com/users/MahboobehMohammadi/events{/privacy}","received_events_url":"https://api.github.com/users/MahboobehMohammadi/received_events","type":"User","site_admin":false},"body":"@brucebinary  when touchend event happens in mobile the drawing ends and this.stx.currentVectorParameters.vectorType will be empty, at the same time we want to remove the cursor, it has a delay. without the timeout `stx.currentVectorParameters.vectorType` is not empty yet so ` if (!stx.currentVectorParameters.vectorType) { this.display = 'none';}`\r\nwill not be executed, so user need to click again to hide the pencil.\r\n","created_at":"2018-08-08T10:04:57Z","updated_at":"2018-08-08T10:04:57Z","html_url":"https://github.com/binary-com/SmartCharts/pull/411#discussion_r208525685","pull_request_url":"https://api.github.com/repos/binary-com/SmartCharts/pulls/411","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/binary-com/SmartCharts/pulls/comments/208525685"},"html":{"href":"https://github.com/binary-com/SmartCharts/pull/411#discussion_r208525685"},"pull_request":{"href":"https://api.github.com/repos/binary-com/SmartCharts/pulls/411"}},"in_reply_to_id":208513365},"pull_request":{"url":"https://api.github.com/repos/binary-com/SmartCharts/pulls/411","id":204343240,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MzQzMjQw","html_url":"https://github.com/binary-com/SmartCharts/pull/411","diff_url":"https://github.com/binary-com/SmartCharts/pull/411.diff","patch_url":"https://github.com/binary-com/SmartCharts/pull/411.patch","issue_url":"https://api.github.com/repos/binary-com/SmartCharts/issues/411","number":411,"state":"open","locked":false,"title":"Make draw tools more intuitive","user":{"login":"MahboobehMohammadi","id":3080372,"node_id":"MDQ6VXNlcjMwODAzNzI=","avatar_url":"https://avatars3.githubusercontent.com/u/3080372?v=4","gravatar_id":"","url":"https://api.github.com/users/MahboobehMohammadi","html_url":"https://github.com/MahboobehMohammadi","followers_url":"https://api.github.com/users/MahboobehMohammadi/followers","following_url":"https://api.github.com/users/MahboobehMohammadi/following{/other_user}","gists_url":"https://api.github.com/users/MahboobehMohammadi/gists{/gist_id}","starred_url":"https://api.github.com/users/MahboobehMohammadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MahboobehMohammadi/subscriptions","organizations_url":"https://api.github.com/users/MahboobehMohammadi/orgs","repos_url":"https://api.github.com/users/MahboobehMohammadi/repos","events_url":"https://api.github.com/users/MahboobehMohammadi/events{/privacy}","received_events_url":"https://api.github.com/users/MahboobehMohammadi/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-27T06:45:08Z","updated_at":"2018-08-08T10:04:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24ac0bf149b95f13c5d7375a26867f72c52d26df","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/binary-com/SmartCharts/pulls/411/commits","review_comments_url":"https://api.github.com/repos/binary-com/SmartCharts/pulls/411/comments","review_comment_url":"https://api.github.com/repos/binary-com/SmartCharts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/binary-com/SmartCharts/issues/411/comments","statuses_url":"https://api.github.com/repos/binary-com/SmartCharts/statuses/fe401305ad4e9016bcd512332a236ad8b78b97ee","head":{"label":"MahboobehMohammadi:draw-tools","ref":"draw-tools","sha":"fe401305ad4e9016bcd512332a236ad8b78b97ee","user":{"login":"MahboobehMohammadi","id":3080372,"node_id":"MDQ6VXNlcjMwODAzNzI=","avatar_url":"https://avatars3.githubusercontent.com/u/3080372?v=4","gravatar_id":"","url":"https://api.github.com/users/MahboobehMohammadi","html_url":"https://github.com/MahboobehMohammadi","followers_url":"https://api.github.com/users/MahboobehMohammadi/followers","following_url":"https://api.github.com/users/MahboobehMohammadi/following{/other_user}","gists_url":"https://api.github.com/users/MahboobehMohammadi/gists{/gist_id}","starred_url":"https://api.github.com/users/MahboobehMohammadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MahboobehMohammadi/subscriptions","organizations_url":"https://api.github.com/users/MahboobehMohammadi/orgs","repos_url":"https://api.github.com/users/MahboobehMohammadi/repos","events_url":"https://api.github.com/users/MahboobehMohammadi/events{/privacy}","received_events_url":"https://api.github.com/users/MahboobehMohammadi/received_events","type":"User","site_admin":false},"repo":{"id":130092412,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAwOTI0MTI=","name":"SmartCharts","full_name":"MahboobehMohammadi/SmartCharts","owner":{"login":"MahboobehMohammadi","id":3080372,"node_id":"MDQ6VXNlcjMwODAzNzI=","avatar_url":"https://avatars3.githubusercontent.com/u/3080372?v=4","gravatar_id":"","url":"https://api.github.com/users/MahboobehMohammadi","html_url":"https://github.com/MahboobehMohammadi","followers_url":"https://api.github.com/users/MahboobehMohammadi/followers","following_url":"https://api.github.com/users/MahboobehMohammadi/following{/other_user}","gists_url":"https://api.github.com/users/MahboobehMohammadi/gists{/gist_id}","starred_url":"https://api.github.com/users/MahboobehMohammadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MahboobehMohammadi/subscriptions","organizations_url":"https://api.github.com/users/MahboobehMohammadi/orgs","repos_url":"https://api.github.com/users/MahboobehMohammadi/repos","events_url":"https://api.github.com/users/MahboobehMohammadi/events{/privacy}","received_events_url":"https://api.github.com/users/MahboobehMohammadi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MahboobehMohammadi/SmartCharts","description":null,"fork":true,"url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts","forks_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/forks","keys_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/teams","hooks_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/hooks","issue_events_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/issues/events{/number}","events_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/events","assignees_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/assignees{/user}","branches_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/branches{/branch}","tags_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/tags","blobs_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/git/refs{/sha}","trees_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/statuses/{sha}","languages_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/languages","stargazers_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/stargazers","contributors_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/contributors","subscribers_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/subscribers","subscription_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/subscription","commits_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/commits{/sha}","git_commits_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/git/commits{/sha}","comments_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/comments{/number}","issue_comment_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/issues/comments{/number}","contents_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/contents/{+path}","compare_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/merges","archive_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/downloads","issues_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/issues{/number}","pulls_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/pulls{/number}","milestones_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/milestones{/number}","notifications_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/labels{/name}","releases_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/releases{/id}","deployments_url":"https://api.github.com/repos/MahboobehMohammadi/SmartCharts/deployments","created_at":"2018-04-18T16:33:54Z","updated_at":"2018-04-18T16:33:56Z","pushed_at":"2018-08-08T06:51:36Z","git_url":"git://github.com/MahboobehMohammadi/SmartCharts.git","ssh_url":"git@github.com:MahboobehMohammadi/SmartCharts.git","clone_url":"https://github.com/MahboobehMohammadi/SmartCharts.git","svn_url":"https://github.com/MahboobehMohammadi/SmartCharts","homepage":null,"size":49022,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"binary-com:dev","ref":"dev","sha":"4f67a45c5fe42470e49aae7dd570a19eeb6f8206","user":{"login":"binary-com","id":7437559,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0Mzc1NTk=","avatar_url":"https://avatars3.githubusercontent.com/u/7437559?v=4","gravatar_id":"","url":"https://api.github.com/users/binary-com","html_url":"https://github.com/binary-com","followers_url":"https://api.github.com/users/binary-com/followers","following_url":"https://api.github.com/users/binary-com/following{/other_user}","gists_url":"https://api.github.com/users/binary-com/gists{/gist_id}","starred_url":"https://api.github.com/users/binary-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binary-com/subscriptions","organizations_url":"https://api.github.com/users/binary-com/orgs","repos_url":"https://api.github.com/users/binary-com/repos","events_url":"https://api.github.com/users/binary-com/events{/privacy}","received_events_url":"https://api.github.com/users/binary-com/received_events","type":"Organization","site_admin":false},"repo":{"id":115597557,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU1OTc1NTc=","name":"SmartCharts","full_name":"binary-com/SmartCharts","owner":{"login":"binary-com","id":7437559,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0Mzc1NTk=","avatar_url":"https://avatars3.githubusercontent.com/u/7437559?v=4","gravatar_id":"","url":"https://api.github.com/users/binary-com","html_url":"https://github.com/binary-com","followers_url":"https://api.github.com/users/binary-com/followers","following_url":"https://api.github.com/users/binary-com/following{/other_user}","gists_url":"https://api.github.com/users/binary-com/gists{/gist_id}","starred_url":"https://api.github.com/users/binary-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binary-com/subscriptions","organizations_url":"https://api.github.com/users/binary-com/orgs","repos_url":"https://api.github.com/users/binary-com/repos","events_url":"https://api.github.com/users/binary-com/events{/privacy}","received_events_url":"https://api.github.com/users/binary-com/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/binary-com/SmartCharts","description":null,"fork":false,"url":"https://api.github.com/repos/binary-com/SmartCharts","forks_url":"https://api.github.com/repos/binary-com/SmartCharts/forks","keys_url":"https://api.github.com/repos/binary-com/SmartCharts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/binary-com/SmartCharts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/binary-com/SmartCharts/teams","hooks_url":"https://api.github.com/repos/binary-com/SmartCharts/hooks","issue_events_url":"https://api.github.com/repos/binary-com/SmartCharts/issues/events{/number}","events_url":"https://api.github.com/repos/binary-com/SmartCharts/events","assignees_url":"https://api.github.com/repos/binary-com/SmartCharts/assignees{/user}","branches_url":"https://api.github.com/repos/binary-com/SmartCharts/branches{/branch}","tags_url":"https://api.github.com/repos/binary-com/SmartCharts/tags","blobs_url":"https://api.github.com/repos/binary-com/SmartCharts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/binary-com/SmartCharts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/binary-com/SmartCharts/git/refs{/sha}","trees_url":"https://api.github.com/repos/binary-com/SmartCharts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/binary-com/SmartCharts/statuses/{sha}","languages_url":"https://api.github.com/repos/binary-com/SmartCharts/languages","stargazers_url":"https://api.github.com/repos/binary-com/SmartCharts/stargazers","contributors_url":"https://api.github.com/repos/binary-com/SmartCharts/contributors","subscribers_url":"https://api.github.com/repos/binary-com/SmartCharts/subscribers","subscription_url":"https://api.github.com/repos/binary-com/SmartCharts/subscription","commits_url":"https://api.github.com/repos/binary-com/SmartCharts/commits{/sha}","git_commits_url":"https://api.github.com/repos/binary-com/SmartCharts/git/commits{/sha}","comments_url":"https://api.github.com/repos/binary-com/SmartCharts/comments{/number}","issue_comment_url":"https://api.github.com/repos/binary-com/SmartCharts/issues/comments{/number}","contents_url":"https://api.github.com/repos/binary-com/SmartCharts/contents/{+path}","compare_url":"https://api.github.com/repos/binary-com/SmartCharts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/binary-com/SmartCharts/merges","archive_url":"https://api.github.com/repos/binary-com/SmartCharts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/binary-com/SmartCharts/downloads","issues_url":"https://api.github.com/repos/binary-com/SmartCharts/issues{/number}","pulls_url":"https://api.github.com/repos/binary-com/SmartCharts/pulls{/number}","milestones_url":"https://api.github.com/repos/binary-com/SmartCharts/milestones{/number}","notifications_url":"https://api.github.com/repos/binary-com/SmartCharts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/binary-com/SmartCharts/labels{/name}","releases_url":"https://api.github.com/repos/binary-com/SmartCharts/releases{/id}","deployments_url":"https://api.github.com/repos/binary-com/SmartCharts/deployments","created_at":"2017-12-28T07:28:49Z","updated_at":"2018-08-08T09:07:30Z","pushed_at":"2018-08-08T10:02:37Z","git_url":"git://github.com/binary-com/SmartCharts.git","ssh_url":"git@github.com:binary-com/SmartCharts.git","clone_url":"https://github.com/binary-com/SmartCharts.git","svn_url":"https://github.com/binary-com/SmartCharts","homepage":null,"size":53740,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":10,"open_issues":11,"watchers":6,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/binary-com/SmartCharts/pulls/411"},"html":{"href":"https://github.com/binary-com/SmartCharts/pull/411"},"issue":{"href":"https://api.github.com/repos/binary-com/SmartCharts/issues/411"},"comments":{"href":"https://api.github.com/repos/binary-com/SmartCharts/issues/411/comments"},"review_comments":{"href":"https://api.github.com/repos/binary-com/SmartCharts/pulls/411/comments"},"review_comment":{"href":"https://api.github.com/repos/binary-com/SmartCharts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/binary-com/SmartCharts/pulls/411/commits"},"statuses":{"href":"https://api.github.com/repos/binary-com/SmartCharts/statuses/fe401305ad4e9016bcd512332a236ad8b78b97ee"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"MahboobehMohammadi"}}