{"action":"created","comment":{"url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/comments/65294407","id":65294407,"diff_hunk":"@@ -1371,109 +1371,114 @@ function makeMediaZoomable(mediaTag) {\n \n \tmediaTag.classList.add('res-media-resizable');\n \n-\tlet dragTargetData;\n+\tlet hasChangedWidth, newWidth, initialWidth, initialDiagonal, minWidth;\n \n \tfunction getDragSize(e) {\n-\t\tconst { left, top } = e.target.getBoundingClientRect();\n+\t\tconst { left, top } = mediaTag.getBoundingClientRect();\n \t\tconst dragSize = Math.hypot(e.clientX - left, e.clientY - top);\n \n \t\treturn Math.round(dragSize);\n \t}\n \n \tconst dragMedia = frameDebounce(e => {\n-\t\tif (!dragTargetData) return;\n-\n \t\tconst newDiagonal = getDragSize(e);\n-\t\tconst oldDiagonal = dragTargetData.diagonal;\n-\n-\t\tif (newDiagonal !== oldDiagonal) {\n-\t\t\tdragTargetData.hasChangedWidth = true;\n \n-\t\t\tconst imageWidth = dragTargetData.imageWidth;\n-\t\t\tconst maxWidth = Math.max(mediaTag.minWidth, newDiagonal / oldDiagonal * imageWidth);\n+\t\tif (newDiagonal !== initialDiagonal) {\n+\t\t\tnewWidth = Math.max(minWidth, newDiagonal / initialDiagonal * initialWidth);","path":"lib/modules/showImages.js","position":null,"original_position":27,"commit_id":"0b919de2b21413c543b6249836ec7ff9340545da","original_commit_id":"1f969245227128b4a2e69f75eacca4106686a2a8","user":{"login":"larsjohnsen","id":1748521,"avatar_url":"https://avatars.githubusercontent.com/u/1748521?v=3","gravatar_id":"","url":"https://api.github.com/users/larsjohnsen","html_url":"https://github.com/larsjohnsen","followers_url":"https://api.github.com/users/larsjohnsen/followers","following_url":"https://api.github.com/users/larsjohnsen/following{/other_user}","gists_url":"https://api.github.com/users/larsjohnsen/gists{/gist_id}","starred_url":"https://api.github.com/users/larsjohnsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsjohnsen/subscriptions","organizations_url":"https://api.github.com/users/larsjohnsen/orgs","repos_url":"https://api.github.com/users/larsjohnsen/repos","events_url":"https://api.github.com/users/larsjohnsen/events{/privacy}","received_events_url":"https://api.github.com/users/larsjohnsen/received_events","type":"User","site_admin":false},"body":"Thanks. Fixed.","created_at":"2016-06-01T02:34:13Z","updated_at":"2016-06-01T02:34:13Z","html_url":"https://github.com/honestbleeps/Reddit-Enhancement-Suite/pull/3026#discussion_r65294407","pull_request_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/3026","_links":{"self":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/comments/65294407"},"html":{"href":"https://github.com/honestbleeps/Reddit-Enhancement-Suite/pull/3026#discussion_r65294407"},"pull_request":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/3026"}}},"pull_request":{"url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/3026","id":71951206,"html_url":"https://github.com/honestbleeps/Reddit-Enhancement-Suite/pull/3026","diff_url":"https://github.com/honestbleeps/Reddit-Enhancement-Suite/pull/3026.diff","patch_url":"https://github.com/honestbleeps/Reddit-Enhancement-Suite/pull/3026.patch","issue_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/issues/3026","number":3026,"state":"open","locked":false,"title":"Use document listeners for makeMediaZoomable and makeMediaMovable","user":{"login":"larsjohnsen","id":1748521,"avatar_url":"https://avatars.githubusercontent.com/u/1748521?v=3","gravatar_id":"","url":"https://api.github.com/users/larsjohnsen","html_url":"https://github.com/larsjohnsen","followers_url":"https://api.github.com/users/larsjohnsen/followers","following_url":"https://api.github.com/users/larsjohnsen/following{/other_user}","gists_url":"https://api.github.com/users/larsjohnsen/gists{/gist_id}","starred_url":"https://api.github.com/users/larsjohnsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsjohnsen/subscriptions","organizations_url":"https://api.github.com/users/larsjohnsen/orgs","repos_url":"https://api.github.com/users/larsjohnsen/repos","events_url":"https://api.github.com/users/larsjohnsen/events{/privacy}","received_events_url":"https://api.github.com/users/larsjohnsen/received_events","type":"User","site_admin":false},"body":"Fixes #924","created_at":"2016-05-31T02:34:24Z","updated_at":"2016-06-01T02:34:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6515ea9dad051a543ad95ba460abc5d5eef4c57","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/3026/commits","review_comments_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/3026/comments","review_comment_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/issues/3026/comments","statuses_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/statuses/0b919de2b21413c543b6249836ec7ff9340545da","head":{"label":"larsjohnsen:makeMediaZoomable-makeMediaMovable-move-listeners-document","ref":"makeMediaZoomable-makeMediaMovable-move-listeners-document","sha":"0b919de2b21413c543b6249836ec7ff9340545da","user":{"login":"larsjohnsen","id":1748521,"avatar_url":"https://avatars.githubusercontent.com/u/1748521?v=3","gravatar_id":"","url":"https://api.github.com/users/larsjohnsen","html_url":"https://github.com/larsjohnsen","followers_url":"https://api.github.com/users/larsjohnsen/followers","following_url":"https://api.github.com/users/larsjohnsen/following{/other_user}","gists_url":"https://api.github.com/users/larsjohnsen/gists{/gist_id}","starred_url":"https://api.github.com/users/larsjohnsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsjohnsen/subscriptions","organizations_url":"https://api.github.com/users/larsjohnsen/orgs","repos_url":"https://api.github.com/users/larsjohnsen/repos","events_url":"https://api.github.com/users/larsjohnsen/events{/privacy}","received_events_url":"https://api.github.com/users/larsjohnsen/received_events","type":"User","site_admin":false},"repo":{"id":54233607,"name":"Reddit-Enhancement-Suite","full_name":"larsjohnsen/Reddit-Enhancement-Suite","owner":{"login":"larsjohnsen","id":1748521,"avatar_url":"https://avatars.githubusercontent.com/u/1748521?v=3","gravatar_id":"","url":"https://api.github.com/users/larsjohnsen","html_url":"https://github.com/larsjohnsen","followers_url":"https://api.github.com/users/larsjohnsen/followers","following_url":"https://api.github.com/users/larsjohnsen/following{/other_user}","gists_url":"https://api.github.com/users/larsjohnsen/gists{/gist_id}","starred_url":"https://api.github.com/users/larsjohnsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsjohnsen/subscriptions","organizations_url":"https://api.github.com/users/larsjohnsen/orgs","repos_url":"https://api.github.com/users/larsjohnsen/repos","events_url":"https://api.github.com/users/larsjohnsen/events{/privacy}","received_events_url":"https://api.github.com/users/larsjohnsen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/larsjohnsen/Reddit-Enhancement-Suite","description":"Reddit Enhancement Suite","fork":true,"url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite","forks_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/forks","keys_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/teams","hooks_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/hooks","issue_events_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/issues/events{/number}","events_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/events","assignees_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/assignees{/user}","branches_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/branches{/branch}","tags_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/tags","blobs_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/git/refs{/sha}","trees_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/statuses/{sha}","languages_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/languages","stargazers_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/stargazers","contributors_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/contributors","subscribers_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/subscribers","subscription_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/subscription","commits_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/commits{/sha}","git_commits_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/git/commits{/sha}","comments_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/comments{/number}","issue_comment_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/issues/comments{/number}","contents_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/contents/{+path}","compare_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/merges","archive_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/downloads","issues_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/issues{/number}","pulls_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/pulls{/number}","milestones_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/milestones{/number}","notifications_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/labels{/name}","releases_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/releases{/id}","deployments_url":"https://api.github.com/repos/larsjohnsen/Reddit-Enhancement-Suite/deployments","created_at":"2016-03-18T21:52:21Z","updated_at":"2016-05-29T08:23:34Z","pushed_at":"2016-06-01T02:34:08Z","git_url":"git://github.com/larsjohnsen/Reddit-Enhancement-Suite.git","ssh_url":"git@github.com:larsjohnsen/Reddit-Enhancement-Suite.git","clone_url":"https://github.com/larsjohnsen/Reddit-Enhancement-Suite.git","svn_url":"https://github.com/larsjohnsen/Reddit-Enhancement-Suite","homepage":"http://redditenhancementsuite.com","size":23070,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"honestbleeps:master","ref":"master","sha":"ac7dc3a45de5b36773bf61fc3e1bc01f3172f018","user":{"login":"honestbleeps","id":323763,"avatar_url":"https://avatars.githubusercontent.com/u/323763?v=3","gravatar_id":"","url":"https://api.github.com/users/honestbleeps","html_url":"https://github.com/honestbleeps","followers_url":"https://api.github.com/users/honestbleeps/followers","following_url":"https://api.github.com/users/honestbleeps/following{/other_user}","gists_url":"https://api.github.com/users/honestbleeps/gists{/gist_id}","starred_url":"https://api.github.com/users/honestbleeps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honestbleeps/subscriptions","organizations_url":"https://api.github.com/users/honestbleeps/orgs","repos_url":"https://api.github.com/users/honestbleeps/repos","events_url":"https://api.github.com/users/honestbleeps/events{/privacy}","received_events_url":"https://api.github.com/users/honestbleeps/received_events","type":"User","site_admin":false},"repo":{"id":2688907,"name":"Reddit-Enhancement-Suite","full_name":"honestbleeps/Reddit-Enhancement-Suite","owner":{"login":"honestbleeps","id":323763,"avatar_url":"https://avatars.githubusercontent.com/u/323763?v=3","gravatar_id":"","url":"https://api.github.com/users/honestbleeps","html_url":"https://github.com/honestbleeps","followers_url":"https://api.github.com/users/honestbleeps/followers","following_url":"https://api.github.com/users/honestbleeps/following{/other_user}","gists_url":"https://api.github.com/users/honestbleeps/gists{/gist_id}","starred_url":"https://api.github.com/users/honestbleeps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honestbleeps/subscriptions","organizations_url":"https://api.github.com/users/honestbleeps/orgs","repos_url":"https://api.github.com/users/honestbleeps/repos","events_url":"https://api.github.com/users/honestbleeps/events{/privacy}","received_events_url":"https://api.github.com/users/honestbleeps/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/honestbleeps/Reddit-Enhancement-Suite","description":"Reddit Enhancement Suite","fork":false,"url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite","forks_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/forks","keys_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/teams","hooks_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/hooks","issue_events_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/issues/events{/number}","events_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/events","assignees_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/assignees{/user}","branches_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/branches{/branch}","tags_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/tags","blobs_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/git/refs{/sha}","trees_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/statuses/{sha}","languages_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/languages","stargazers_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/stargazers","contributors_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/contributors","subscribers_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/subscribers","subscription_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/subscription","commits_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/commits{/sha}","git_commits_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/git/commits{/sha}","comments_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/comments{/number}","issue_comment_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/issues/comments{/number}","contents_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/contents/{+path}","compare_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/merges","archive_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/downloads","issues_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/issues{/number}","pulls_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls{/number}","milestones_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/milestones{/number}","notifications_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/labels{/name}","releases_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/releases{/id}","deployments_url":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/deployments","created_at":"2011-11-01T16:31:51Z","updated_at":"2016-05-28T22:34:22Z","pushed_at":"2016-06-01T02:34:09Z","git_url":"git://github.com/honestbleeps/Reddit-Enhancement-Suite.git","ssh_url":"git@github.com:honestbleeps/Reddit-Enhancement-Suite.git","clone_url":"https://github.com/honestbleeps/Reddit-Enhancement-Suite.git","svn_url":"https://github.com/honestbleeps/Reddit-Enhancement-Suite","homepage":"http://redditenhancementsuite.com","size":122929,"stargazers_count":1088,"watchers_count":1088,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":500,"mirror_url":null,"open_issues_count":571,"forks":500,"open_issues":571,"watchers":1088,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/3026"},"html":{"href":"https://github.com/honestbleeps/Reddit-Enhancement-Suite/pull/3026"},"issue":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/issues/3026"},"comments":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/issues/3026/comments"},"review_comments":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/3026/comments"},"review_comment":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/pulls/3026/commits"},"statuses":{"href":"https://api.github.com/repos/honestbleeps/Reddit-Enhancement-Suite/statuses/0b919de2b21413c543b6249836ec7ff9340545da"}}}}
{"actor":{"display_login":"larsjohnsen"}}