{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/comments/84368579","pull_request_review_id":5151799,"id":84368579,"diff_hunk":"@@ -71,9 +71,38 @@\n    * Проверяет, валидны ли данные, в форме кадрирования.\n    * @return {boolean}\n    */\n-  var resizeFormIsValid = function() {\n-    return true;\n-  };\n+  var x = document.querySelector('#resize-x');\n+  var y = document.querySelector('#resize-y');\n+  var size = document.querySelector('#resize-size');\n+  var fwd = document.querySelector('#resize-fwd');\n+\n+  function resizeFormIsValid() {\n+    var imageSizeWidth = currentResizer._image.naturalWidth;\n+    var imageSizeHeight = currentResizer._image.naturalHeight;\n+    var newX = Number(x.value);\n+    var newY = Number(y.value);\n+    var newSize = Number(size.value);\n+\n+    return !(newX < 0 ||\n+        newY < 0 ||\n+        newX + newSize >= imageSizeWidth ||\n+        newY + newSize >= imageSizeHeight ||\n+        isNaN(newY) ||\n+        isNaN(newSize) ||\n+        isNaN(newX));\n+  }\n+\n+  function changeDisable() {\n+    if (resizeFormIsValid()) {\n+      fwd.classList.remove('disabled');\n+    } else {\n+      fwd.classList.add('disabled');","path":"src/js/upload.js","position":32,"original_position":32,"commit_id":"ede0ba6193b014f125b9487481031dd0d0b1fc26","original_commit_id":"ede0ba6193b014f125b9487481031dd0d0b1fc26","user":{"login":"isqua","id":529247,"avatar_url":"https://avatars.githubusercontent.com/u/529247?v=3","gravatar_id":"","url":"https://api.github.com/users/isqua","html_url":"https://github.com/isqua","followers_url":"https://api.github.com/users/isqua/followers","following_url":"https://api.github.com/users/isqua/following{/other_user}","gists_url":"https://api.github.com/users/isqua/gists{/gist_id}","starred_url":"https://api.github.com/users/isqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isqua/subscriptions","organizations_url":"https://api.github.com/users/isqua/orgs","repos_url":"https://api.github.com/users/isqua/repos","events_url":"https://api.github.com/users/isqua/events{/privacy}","received_events_url":"https://api.github.com/users/isqua/received_events","type":"User","site_admin":false},"body":"Класс никак не поможет. Кнопка всё равно будет кликабельной, даже если будет выглядеть некликабельной. [У кнопок](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement) есть специальный атрибут `disabled`. У него как раз нужное поведение. Поэксперименти.","created_at":"2016-10-20T20:26:11Z","updated_at":"2016-10-20T20:41:05Z","html_url":"https://github.com/htmlacademy-javascript/67126-kekstagram/pull/6#discussion_r84368579","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/comments/84368579"},"html":{"href":"https://github.com/htmlacademy-javascript/67126-kekstagram/pull/6#discussion_r84368579"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/6","id":90260498,"html_url":"https://github.com/htmlacademy-javascript/67126-kekstagram/pull/6","diff_url":"https://github.com/htmlacademy-javascript/67126-kekstagram/pull/6.diff","patch_url":"https://github.com/htmlacademy-javascript/67126-kekstagram/pull/6.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/issues/6","number":6,"state":"open","locked":false,"title":"Валидация","user":{"login":"Stotyka","id":18396067,"avatar_url":"https://avatars.githubusercontent.com/u/18396067?v=3","gravatar_id":"","url":"https://api.github.com/users/Stotyka","html_url":"https://github.com/Stotyka","followers_url":"https://api.github.com/users/Stotyka/followers","following_url":"https://api.github.com/users/Stotyka/following{/other_user}","gists_url":"https://api.github.com/users/Stotyka/gists{/gist_id}","starred_url":"https://api.github.com/users/Stotyka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stotyka/subscriptions","organizations_url":"https://api.github.com/users/Stotyka/orgs","repos_url":"https://api.github.com/users/Stotyka/repos","events_url":"https://api.github.com/users/Stotyka/events{/privacy}","received_events_url":"https://api.github.com/users/Stotyka/received_events","type":"User","site_admin":false},"body":"Проверяем, валидны ли данные, в форме кадрирования","created_at":"2016-10-20T18:58:10Z","updated_at":"2016-10-20T20:41:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e44ae1a56237587564695d58f21a9bd429bbfc0","assignee":{"login":"isqua","id":529247,"avatar_url":"https://avatars.githubusercontent.com/u/529247?v=3","gravatar_id":"","url":"https://api.github.com/users/isqua","html_url":"https://github.com/isqua","followers_url":"https://api.github.com/users/isqua/followers","following_url":"https://api.github.com/users/isqua/following{/other_user}","gists_url":"https://api.github.com/users/isqua/gists{/gist_id}","starred_url":"https://api.github.com/users/isqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isqua/subscriptions","organizations_url":"https://api.github.com/users/isqua/orgs","repos_url":"https://api.github.com/users/isqua/repos","events_url":"https://api.github.com/users/isqua/events{/privacy}","received_events_url":"https://api.github.com/users/isqua/received_events","type":"User","site_admin":false},"assignees":[{"login":"isqua","id":529247,"avatar_url":"https://avatars.githubusercontent.com/u/529247?v=3","gravatar_id":"","url":"https://api.github.com/users/isqua","html_url":"https://github.com/isqua","followers_url":"https://api.github.com/users/isqua/followers","following_url":"https://api.github.com/users/isqua/following{/other_user}","gists_url":"https://api.github.com/users/isqua/gists{/gist_id}","starred_url":"https://api.github.com/users/isqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isqua/subscriptions","organizations_url":"https://api.github.com/users/isqua/orgs","repos_url":"https://api.github.com/users/isqua/repos","events_url":"https://api.github.com/users/isqua/events{/privacy}","received_events_url":"https://api.github.com/users/isqua/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/6/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/6/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/issues/6/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/statuses/ede0ba6193b014f125b9487481031dd0d0b1fc26","head":{"label":"Stotyka:module3-task1","ref":"module3-task1","sha":"ede0ba6193b014f125b9487481031dd0d0b1fc26","user":{"login":"Stotyka","id":18396067,"avatar_url":"https://avatars.githubusercontent.com/u/18396067?v=3","gravatar_id":"","url":"https://api.github.com/users/Stotyka","html_url":"https://github.com/Stotyka","followers_url":"https://api.github.com/users/Stotyka/followers","following_url":"https://api.github.com/users/Stotyka/following{/other_user}","gists_url":"https://api.github.com/users/Stotyka/gists{/gist_id}","starred_url":"https://api.github.com/users/Stotyka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stotyka/subscriptions","organizations_url":"https://api.github.com/users/Stotyka/orgs","repos_url":"https://api.github.com/users/Stotyka/repos","events_url":"https://api.github.com/users/Stotyka/events{/privacy}","received_events_url":"https://api.github.com/users/Stotyka/received_events","type":"User","site_admin":false},"repo":{"id":70088919,"name":"67126-kekstagram-1","full_name":"Stotyka/67126-kekstagram-1","owner":{"login":"Stotyka","id":18396067,"avatar_url":"https://avatars.githubusercontent.com/u/18396067?v=3","gravatar_id":"","url":"https://api.github.com/users/Stotyka","html_url":"https://github.com/Stotyka","followers_url":"https://api.github.com/users/Stotyka/followers","following_url":"https://api.github.com/users/Stotyka/following{/other_user}","gists_url":"https://api.github.com/users/Stotyka/gists{/gist_id}","starred_url":"https://api.github.com/users/Stotyka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stotyka/subscriptions","organizations_url":"https://api.github.com/users/Stotyka/orgs","repos_url":"https://api.github.com/users/Stotyka/repos","events_url":"https://api.github.com/users/Stotyka/events{/privacy}","received_events_url":"https://api.github.com/users/Stotyka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Stotyka/67126-kekstagram-1","description":"Yuriy Stotyka","fork":true,"url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1","forks_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/forks","keys_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/teams","hooks_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/hooks","issue_events_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/issues/events{/number}","events_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/events","assignees_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/assignees{/user}","branches_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/branches{/branch}","tags_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/tags","blobs_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/statuses/{sha}","languages_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/languages","stargazers_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/stargazers","contributors_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/contributors","subscribers_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/subscribers","subscription_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/subscription","commits_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/contents/{+path}","compare_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/merges","archive_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/downloads","issues_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/issues{/number}","pulls_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/pulls{/number}","milestones_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/milestones{/number}","notifications_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/labels{/name}","releases_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/releases{/id}","deployments_url":"https://api.github.com/repos/Stotyka/67126-kekstagram-1/deployments","created_at":"2016-10-05T18:46:51Z","updated_at":"2016-10-05T18:46:53Z","pushed_at":"2016-10-20T18:58:09Z","git_url":"git://github.com/Stotyka/67126-kekstagram-1.git","ssh_url":"git@github.com:Stotyka/67126-kekstagram-1.git","clone_url":"https://github.com/Stotyka/67126-kekstagram-1.git","svn_url":"https://github.com/Stotyka/67126-kekstagram-1","homepage":null,"size":4314,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"htmlacademy-javascript:master","ref":"master","sha":"82fe3804c3d3ddde432d6a5e09864558ca106312","user":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars.githubusercontent.com/u/14179712?v=3","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"repo":{"id":70035535,"name":"67126-kekstagram","full_name":"htmlacademy-javascript/67126-kekstagram","owner":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars.githubusercontent.com/u/14179712?v=3","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/htmlacademy-javascript/67126-kekstagram","description":"Yuriy Stotyka","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram","forks_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/deployments","created_at":"2016-10-05T06:32:15Z","updated_at":"2016-10-06T13:32:30Z","pushed_at":"2016-10-20T18:58:10Z","git_url":"git://github.com/htmlacademy-javascript/67126-kekstagram.git","ssh_url":"git@github.com:htmlacademy-javascript/67126-kekstagram.git","clone_url":"https://github.com/htmlacademy-javascript/67126-kekstagram.git","svn_url":"https://github.com/htmlacademy-javascript/67126-kekstagram","homepage":"https://github.com/Stotyka/67126-kekstagram-1","size":4370,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/6"},"html":{"href":"https://github.com/htmlacademy-javascript/67126-kekstagram/pull/6"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/issues/6"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/67126-kekstagram/statuses/ede0ba6193b014f125b9487481031dd0d0b1fc26"}}}}
{"actor":{"display_login":"isqua"}}