{"action":"created","comment":{"url":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/24964727","id":24964727,"diff_hunk":"@@ -1,49 +1,72 @@\n /**\n+ * Callback which is called upon at some point during a drag event in React.\n+ *\n+ * @callback drawCallback\n+ * @param {event} event The original mouse event.\n+ */\n+\n+/**\n  * This utility implements dragging for SVG elements in React. That is, it\n  * wraps mouse events and simulates drag events, but does not support complex\n  * drag-and-drop functionality.\n- * \n+ *\n  * Users of this utility should define the three callbacks and then set the\n  * onMouseDown of the draggable element to mouseDownDrag.bind(this,\n  * someUniqueName, myPseudoDragStartCallback, myPseudoDragEndCallback,\n  * myPseudoDragCallback). someUniqueName can be anything, as long it's unique\n  * within the component.\n- * \n+ *\n  * The using component can check its state for the key\n  * (someUniqueName + '_dragging') to see if a particular draggee is dragging.\n+ *\n+ * @param {*} name - Name which is used to uniquely identify *this* drag event.\n+ * @param {dragCallback} pseudoDragStartCallback - Callback which is fired\n+ * upon the start of a drag event.\n+ * @param {dragCallback} pseudoDragEndCallback - Callback which is fired upon\n+ * the end of a drag event.\n+ * @param {dragCallback} pseudoDragCallback - Callback which is fired when the\n+ * mouse moves. Use this to update the position of whatever is being drawn.\n+ * @param {event} event - The original mouse event?\n+ * @returns {void}\n  */\n var mouseDownDrag = function(name, pseudoDragStartCallback, pseudoDragEndCallback, pseudoDragCallback, event) {\n-    // Turn on the dragging flag and store the initial drag position in state.\n-    var newState = {};\n-    newState[name + '_dragging'] = true;\n-    this.setState(newState);\n \n-    // Register event handlers to terminate dragging when the mouse leaves the window or when the button is released.\n-    window.onmouseup = window.onmouseleave = function(name, event) {\n-        // Turn off the dragging flag.\n-        var newState = {};\n-        newState[name + '_dragging'] = false;\n-        this.setState(newState);\n-        // Remove mouse listeners from the window.\n-        window.onmousemove = null;\n-        window.onmouseleave = null;\n-        // Call the pseudo drag end callback.\n-        if (pseudoDragEndCallback) {\n-            pseudoDragEndCallback(event);\n-        }\n-    }.bind(this, name);\n+  // Turn on the dragging flag and store the initial drag position in state.\n+  var newState = {};\n+  newState[name + '_dragging'] = true;\n+  this.setState(newState);\n \n-    // Register the pseudo drag callback.\n-    window.onmousemove = function(name, pseudoDragCallback, event) {\n-        if (this.state[name + '_dragging'] && pseudoDragCallback) {\n-            pseudoDragCallback(event);\n-        }\n-    }.bind(this, name, pseudoDragCallback);\n+  // Register event handlers to terminate dragging when the mouse leaves\n+  // the window or when the button is released.\n+  // Note that we're turning off the ESLint 'no shadow' rule check here.","path":"lib/utilities/mouseDownDrag.js","position":67,"original_position":67,"commit_id":"1ab59c8801a00a89c25f5c4eb4ee8c4c1c863265","original_commit_id":"1ab59c8801a00a89c25f5c4eb4ee8c4c1c863265","user":{"login":"MorganCabral","id":960318,"avatar_url":"https://avatars.githubusercontent.com/u/960318?v=3","gravatar_id":"","url":"https://api.github.com/users/MorganCabral","html_url":"https://github.com/MorganCabral","followers_url":"https://api.github.com/users/MorganCabral/followers","following_url":"https://api.github.com/users/MorganCabral/following{/other_user}","gists_url":"https://api.github.com/users/MorganCabral/gists{/gist_id}","starred_url":"https://api.github.com/users/MorganCabral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorganCabral/subscriptions","organizations_url":"https://api.github.com/users/MorganCabral/orgs","repos_url":"https://api.github.com/users/MorganCabral/repos","events_url":"https://api.github.com/users/MorganCabral/events{/privacy}","received_events_url":"https://api.github.com/users/MorganCabral/received_events","type":"User","site_admin":false},"body":"I'm honestly not even sure if the shadowing rule is something we should be following. I understand why it occurs in this instance but I haven't put a lot of thought into whether or not its even a bad thing in this case.","created_at":"2015-02-19T04:01:27Z","updated_at":"2015-02-19T04:01:27Z","html_url":"https://github.com/twosigma/goll-e/pull/10#discussion_r24964727","pull_request_url":"https://api.github.com/repos/twosigma/goll-e/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/24964727"},"html":{"href":"https://github.com/twosigma/goll-e/pull/10#discussion_r24964727"},"pull_request":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/twosigma/goll-e/pulls/10","id":29417913,"html_url":"https://github.com/twosigma/goll-e/pull/10","diff_url":"https://github.com/twosigma/goll-e/pull/10.diff","patch_url":"https://github.com/twosigma/goll-e/pull/10.patch","issue_url":"https://api.github.com/repos/twosigma/goll-e/issues/10","number":10,"state":"open","locked":false,"title":"Replace JSHint with ESLint. [GOL-91]","user":{"login":"MorganCabral","id":960318,"avatar_url":"https://avatars.githubusercontent.com/u/960318?v=3","gravatar_id":"","url":"https://api.github.com/users/MorganCabral","html_url":"https://github.com/MorganCabral","followers_url":"https://api.github.com/users/MorganCabral/followers","following_url":"https://api.github.com/users/MorganCabral/following{/other_user}","gists_url":"https://api.github.com/users/MorganCabral/gists{/gist_id}","starred_url":"https://api.github.com/users/MorganCabral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorganCabral/subscriptions","organizations_url":"https://api.github.com/users/MorganCabral/orgs","repos_url":"https://api.github.com/users/MorganCabral/repos","events_url":"https://api.github.com/users/MorganCabral/events{/privacy}","received_events_url":"https://api.github.com/users/MorganCabral/received_events","type":"User","site_admin":false},"body":"ESLint is a better linting tool than JSHint. It has built-in support for ReactJS and is a lot more flexible with rules, while maintaining compatibility with JSLint and JSHint. \r\n\r\nI did some code cleanup as part of this work as well to improve the quality of our code. Take a look at the last commit message for more specific information.","created_at":"2015-02-17T04:48:36Z","updated_at":"2015-02-19T04:01:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b7d3ff2569d88640cf4965c72f78e4995ec8753","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twosigma/goll-e/pulls/10/commits","review_comments_url":"https://api.github.com/repos/twosigma/goll-e/pulls/10/comments","review_comment_url":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/{number}","comments_url":"https://api.github.com/repos/twosigma/goll-e/issues/10/comments","statuses_url":"https://api.github.com/repos/twosigma/goll-e/statuses/1ab59c8801a00a89c25f5c4eb4ee8c4c1c863265","head":{"label":"gol-91-eslint","ref":"gol-91-eslint","sha":"1ab59c8801a00a89c25f5c4eb4ee8c4c1c863265","user":{"login":"twosigma","id":4049181,"avatar_url":"https://avatars.githubusercontent.com/u/4049181?v=3","gravatar_id":"","url":"https://api.github.com/users/twosigma","html_url":"https://github.com/twosigma","followers_url":"https://api.github.com/users/twosigma/followers","following_url":"https://api.github.com/users/twosigma/following{/other_user}","gists_url":"https://api.github.com/users/twosigma/gists{/gist_id}","starred_url":"https://api.github.com/users/twosigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosigma/subscriptions","organizations_url":"https://api.github.com/users/twosigma/orgs","repos_url":"https://api.github.com/users/twosigma/repos","events_url":"https://api.github.com/users/twosigma/events{/privacy}","received_events_url":"https://api.github.com/users/twosigma/received_events","type":"Organization","site_admin":false},"repo":{"id":23775641,"name":"goll-e","full_name":"twosigma/goll-e","owner":{"login":"twosigma","id":4049181,"avatar_url":"https://avatars.githubusercontent.com/u/4049181?v=3","gravatar_id":"","url":"https://api.github.com/users/twosigma","html_url":"https://github.com/twosigma","followers_url":"https://api.github.com/users/twosigma/followers","following_url":"https://api.github.com/users/twosigma/following{/other_user}","gists_url":"https://api.github.com/users/twosigma/gists{/gist_id}","starred_url":"https://api.github.com/users/twosigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosigma/subscriptions","organizations_url":"https://api.github.com/users/twosigma/orgs","repos_url":"https://api.github.com/users/twosigma/repos","events_url":"https://api.github.com/users/twosigma/events{/privacy}","received_events_url":"https://api.github.com/users/twosigma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twosigma/goll-e","description":"Graph Object Language and Layout Editor","fork":false,"url":"https://api.github.com/repos/twosigma/goll-e","forks_url":"https://api.github.com/repos/twosigma/goll-e/forks","keys_url":"https://api.github.com/repos/twosigma/goll-e/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twosigma/goll-e/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twosigma/goll-e/teams","hooks_url":"https://api.github.com/repos/twosigma/goll-e/hooks","issue_events_url":"https://api.github.com/repos/twosigma/goll-e/issues/events{/number}","events_url":"https://api.github.com/repos/twosigma/goll-e/events","assignees_url":"https://api.github.com/repos/twosigma/goll-e/assignees{/user}","branches_url":"https://api.github.com/repos/twosigma/goll-e/branches{/branch}","tags_url":"https://api.github.com/repos/twosigma/goll-e/tags","blobs_url":"https://api.github.com/repos/twosigma/goll-e/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twosigma/goll-e/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twosigma/goll-e/git/refs{/sha}","trees_url":"https://api.github.com/repos/twosigma/goll-e/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twosigma/goll-e/statuses/{sha}","languages_url":"https://api.github.com/repos/twosigma/goll-e/languages","stargazers_url":"https://api.github.com/repos/twosigma/goll-e/stargazers","contributors_url":"https://api.github.com/repos/twosigma/goll-e/contributors","subscribers_url":"https://api.github.com/repos/twosigma/goll-e/subscribers","subscription_url":"https://api.github.com/repos/twosigma/goll-e/subscription","commits_url":"https://api.github.com/repos/twosigma/goll-e/commits{/sha}","git_commits_url":"https://api.github.com/repos/twosigma/goll-e/git/commits{/sha}","comments_url":"https://api.github.com/repos/twosigma/goll-e/comments{/number}","issue_comment_url":"https://api.github.com/repos/twosigma/goll-e/issues/comments/{number}","contents_url":"https://api.github.com/repos/twosigma/goll-e/contents/{+path}","compare_url":"https://api.github.com/repos/twosigma/goll-e/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twosigma/goll-e/merges","archive_url":"https://api.github.com/repos/twosigma/goll-e/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twosigma/goll-e/downloads","issues_url":"https://api.github.com/repos/twosigma/goll-e/issues{/number}","pulls_url":"https://api.github.com/repos/twosigma/goll-e/pulls{/number}","milestones_url":"https://api.github.com/repos/twosigma/goll-e/milestones{/number}","notifications_url":"https://api.github.com/repos/twosigma/goll-e/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twosigma/goll-e/labels{/name}","releases_url":"https://api.github.com/repos/twosigma/goll-e/releases{/id}","created_at":"2014-09-08T01:19:14Z","updated_at":"2014-10-02T14:48:36Z","pushed_at":"2015-02-19T03:23:57Z","git_url":"git://github.com/twosigma/goll-e.git","ssh_url":"git@github.com:twosigma/goll-e.git","clone_url":"https://github.com/twosigma/goll-e.git","svn_url":"https://github.com/twosigma/goll-e","homepage":null,"size":1359,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":3,"default_branch":"master"}},"base":{"label":"develop","ref":"develop","sha":"d70b5499f0eb87352b895c30f78a0e392e0d91b0","user":{"login":"twosigma","id":4049181,"avatar_url":"https://avatars.githubusercontent.com/u/4049181?v=3","gravatar_id":"","url":"https://api.github.com/users/twosigma","html_url":"https://github.com/twosigma","followers_url":"https://api.github.com/users/twosigma/followers","following_url":"https://api.github.com/users/twosigma/following{/other_user}","gists_url":"https://api.github.com/users/twosigma/gists{/gist_id}","starred_url":"https://api.github.com/users/twosigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosigma/subscriptions","organizations_url":"https://api.github.com/users/twosigma/orgs","repos_url":"https://api.github.com/users/twosigma/repos","events_url":"https://api.github.com/users/twosigma/events{/privacy}","received_events_url":"https://api.github.com/users/twosigma/received_events","type":"Organization","site_admin":false},"repo":{"id":23775641,"name":"goll-e","full_name":"twosigma/goll-e","owner":{"login":"twosigma","id":4049181,"avatar_url":"https://avatars.githubusercontent.com/u/4049181?v=3","gravatar_id":"","url":"https://api.github.com/users/twosigma","html_url":"https://github.com/twosigma","followers_url":"https://api.github.com/users/twosigma/followers","following_url":"https://api.github.com/users/twosigma/following{/other_user}","gists_url":"https://api.github.com/users/twosigma/gists{/gist_id}","starred_url":"https://api.github.com/users/twosigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosigma/subscriptions","organizations_url":"https://api.github.com/users/twosigma/orgs","repos_url":"https://api.github.com/users/twosigma/repos","events_url":"https://api.github.com/users/twosigma/events{/privacy}","received_events_url":"https://api.github.com/users/twosigma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twosigma/goll-e","description":"Graph Object Language and Layout Editor","fork":false,"url":"https://api.github.com/repos/twosigma/goll-e","forks_url":"https://api.github.com/repos/twosigma/goll-e/forks","keys_url":"https://api.github.com/repos/twosigma/goll-e/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twosigma/goll-e/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twosigma/goll-e/teams","hooks_url":"https://api.github.com/repos/twosigma/goll-e/hooks","issue_events_url":"https://api.github.com/repos/twosigma/goll-e/issues/events{/number}","events_url":"https://api.github.com/repos/twosigma/goll-e/events","assignees_url":"https://api.github.com/repos/twosigma/goll-e/assignees{/user}","branches_url":"https://api.github.com/repos/twosigma/goll-e/branches{/branch}","tags_url":"https://api.github.com/repos/twosigma/goll-e/tags","blobs_url":"https://api.github.com/repos/twosigma/goll-e/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twosigma/goll-e/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twosigma/goll-e/git/refs{/sha}","trees_url":"https://api.github.com/repos/twosigma/goll-e/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twosigma/goll-e/statuses/{sha}","languages_url":"https://api.github.com/repos/twosigma/goll-e/languages","stargazers_url":"https://api.github.com/repos/twosigma/goll-e/stargazers","contributors_url":"https://api.github.com/repos/twosigma/goll-e/contributors","subscribers_url":"https://api.github.com/repos/twosigma/goll-e/subscribers","subscription_url":"https://api.github.com/repos/twosigma/goll-e/subscription","commits_url":"https://api.github.com/repos/twosigma/goll-e/commits{/sha}","git_commits_url":"https://api.github.com/repos/twosigma/goll-e/git/commits{/sha}","comments_url":"https://api.github.com/repos/twosigma/goll-e/comments{/number}","issue_comment_url":"https://api.github.com/repos/twosigma/goll-e/issues/comments/{number}","contents_url":"https://api.github.com/repos/twosigma/goll-e/contents/{+path}","compare_url":"https://api.github.com/repos/twosigma/goll-e/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twosigma/goll-e/merges","archive_url":"https://api.github.com/repos/twosigma/goll-e/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twosigma/goll-e/downloads","issues_url":"https://api.github.com/repos/twosigma/goll-e/issues{/number}","pulls_url":"https://api.github.com/repos/twosigma/goll-e/pulls{/number}","milestones_url":"https://api.github.com/repos/twosigma/goll-e/milestones{/number}","notifications_url":"https://api.github.com/repos/twosigma/goll-e/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twosigma/goll-e/labels{/name}","releases_url":"https://api.github.com/repos/twosigma/goll-e/releases{/id}","created_at":"2014-09-08T01:19:14Z","updated_at":"2014-10-02T14:48:36Z","pushed_at":"2015-02-19T03:23:57Z","git_url":"git://github.com/twosigma/goll-e.git","ssh_url":"git@github.com:twosigma/goll-e.git","clone_url":"https://github.com/twosigma/goll-e.git","svn_url":"https://github.com/twosigma/goll-e","homepage":null,"size":1359,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/10"},"html":{"href":"https://github.com/twosigma/goll-e/pull/10"},"issue":{"href":"https://api.github.com/repos/twosigma/goll-e/issues/10"},"comments":{"href":"https://api.github.com/repos/twosigma/goll-e/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/twosigma/goll-e/statuses/1ab59c8801a00a89c25f5c4eb4ee8c4c1c863265"}}}}