{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/comments/84719623","pull_request_review_id":5479416,"id":84719623,"diff_hunk":"@@ -3,6 +3,39 @@\n window.form = (function() {\n   var formContainer = document.querySelector('.overlay-container');\n   var formCloseButton = document.querySelector('.review-form-close');\n+  var formRequired = document.querySelector('.review-form');\n+  var inputsGroup = document.querySelector('.review-form-group');\n+\n+  var requiredName = document.getElementById('review-name');\n+  requiredName.required = true;\n+  requiredName.oninput = function() {\n+    document.querySelector('.review-fields-name').classList.add('invisible');\n+  };\n+\n+  function validate() {\n+    var elem = document.getElementById('review-text');\n+    elem.required = Number(formRequired['review-mark'].value) < 3;\n+  }\n+\n+  inputsGroup.onchange = function() {\n+    validate();\n+  };\n+\n+  validate();\n+\n+  var requiredText = document.getElementById('review-text');\n+  requiredText.oninput = function() {\n+    document.querySelector('.review-fields-text').classList.add('invisible');\n+  };\n+\n+  formRequired.addEventListener('submit', function(event) {\n+    if (!requiredName.validity.valid && !requiredText.validity.valid) {\n+      event.preventDefault();\n+      document.querySelector('.review-submit').disabled = true;","path":"src/js/form.js","position":32,"original_position":32,"commit_id":"f896e3846efa7adb806553096dbd93f8570f2f63","original_commit_id":"f896e3846efa7adb806553096dbd93f8570f2f63","user":{"login":"demeshkin","id":522683,"avatar_url":"https://avatars.githubusercontent.com/u/522683?v=3","gravatar_id":"","url":"https://api.github.com/users/demeshkin","html_url":"https://github.com/demeshkin","followers_url":"https://api.github.com/users/demeshkin/followers","following_url":"https://api.github.com/users/demeshkin/following{/other_user}","gists_url":"https://api.github.com/users/demeshkin/gists{/gist_id}","starred_url":"https://api.github.com/users/demeshkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demeshkin/subscriptions","organizations_url":"https://api.github.com/users/demeshkin/orgs","repos_url":"https://api.github.com/users/demeshkin/repos","events_url":"https://api.github.com/users/demeshkin/events{/privacy}","received_events_url":"https://api.github.com/users/demeshkin/received_events","type":"User","site_admin":false},"body":"Нужно дизейблить кнопку во время заполнения формы, а не при отправке. В задании:\r\n\r\n`Если данные, введённые в форму, невалидны, форму должно быть невозможно отправить. При этом кнопка отправки должна быть деактивирована (добавлен атрибут disabled).`","created_at":"2016-10-24T15:54:11Z","updated_at":"2016-10-24T15:54:11Z","html_url":"https://github.com/htmlacademy-javascript/110324-code-and-magick/pull/6#discussion_r84719623","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/comments/84719623"},"html":{"href":"https://github.com/htmlacademy-javascript/110324-code-and-magick/pull/6#discussion_r84719623"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/6","id":90307651,"html_url":"https://github.com/htmlacademy-javascript/110324-code-and-magick/pull/6","diff_url":"https://github.com/htmlacademy-javascript/110324-code-and-magick/pull/6.diff","patch_url":"https://github.com/htmlacademy-javascript/110324-code-and-magick/pull/6.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/issues/6","number":6,"state":"open","locked":false,"title":"Валидация","user":{"login":"davegahn","id":16261282,"avatar_url":"https://avatars.githubusercontent.com/u/16261282?v=3","gravatar_id":"","url":"https://api.github.com/users/davegahn","html_url":"https://github.com/davegahn","followers_url":"https://api.github.com/users/davegahn/followers","following_url":"https://api.github.com/users/davegahn/following{/other_user}","gists_url":"https://api.github.com/users/davegahn/gists{/gist_id}","starred_url":"https://api.github.com/users/davegahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davegahn/subscriptions","organizations_url":"https://api.github.com/users/davegahn/orgs","repos_url":"https://api.github.com/users/davegahn/repos","events_url":"https://api.github.com/users/davegahn/events{/privacy}","received_events_url":"https://api.github.com/users/davegahn/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-21T01:05:19Z","updated_at":"2016-10-24T15:54:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"937ab9ba3ad5ca5d54b340abfb2a7d4646aeb453","assignee":{"login":"demeshkin","id":522683,"avatar_url":"https://avatars.githubusercontent.com/u/522683?v=3","gravatar_id":"","url":"https://api.github.com/users/demeshkin","html_url":"https://github.com/demeshkin","followers_url":"https://api.github.com/users/demeshkin/followers","following_url":"https://api.github.com/users/demeshkin/following{/other_user}","gists_url":"https://api.github.com/users/demeshkin/gists{/gist_id}","starred_url":"https://api.github.com/users/demeshkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demeshkin/subscriptions","organizations_url":"https://api.github.com/users/demeshkin/orgs","repos_url":"https://api.github.com/users/demeshkin/repos","events_url":"https://api.github.com/users/demeshkin/events{/privacy}","received_events_url":"https://api.github.com/users/demeshkin/received_events","type":"User","site_admin":false},"assignees":[{"login":"demeshkin","id":522683,"avatar_url":"https://avatars.githubusercontent.com/u/522683?v=3","gravatar_id":"","url":"https://api.github.com/users/demeshkin","html_url":"https://github.com/demeshkin","followers_url":"https://api.github.com/users/demeshkin/followers","following_url":"https://api.github.com/users/demeshkin/following{/other_user}","gists_url":"https://api.github.com/users/demeshkin/gists{/gist_id}","starred_url":"https://api.github.com/users/demeshkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demeshkin/subscriptions","organizations_url":"https://api.github.com/users/demeshkin/orgs","repos_url":"https://api.github.com/users/demeshkin/repos","events_url":"https://api.github.com/users/demeshkin/events{/privacy}","received_events_url":"https://api.github.com/users/demeshkin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/6/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/6/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/issues/6/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/statuses/f896e3846efa7adb806553096dbd93f8570f2f63","head":{"label":"davegahn:module3-task1","ref":"module3-task1","sha":"f896e3846efa7adb806553096dbd93f8570f2f63","user":{"login":"davegahn","id":16261282,"avatar_url":"https://avatars.githubusercontent.com/u/16261282?v=3","gravatar_id":"","url":"https://api.github.com/users/davegahn","html_url":"https://github.com/davegahn","followers_url":"https://api.github.com/users/davegahn/followers","following_url":"https://api.github.com/users/davegahn/following{/other_user}","gists_url":"https://api.github.com/users/davegahn/gists{/gist_id}","starred_url":"https://api.github.com/users/davegahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davegahn/subscriptions","organizations_url":"https://api.github.com/users/davegahn/orgs","repos_url":"https://api.github.com/users/davegahn/repos","events_url":"https://api.github.com/users/davegahn/events{/privacy}","received_events_url":"https://api.github.com/users/davegahn/received_events","type":"User","site_admin":false},"repo":{"id":70253616,"name":"110324-code-and-magick","full_name":"davegahn/110324-code-and-magick","owner":{"login":"davegahn","id":16261282,"avatar_url":"https://avatars.githubusercontent.com/u/16261282?v=3","gravatar_id":"","url":"https://api.github.com/users/davegahn","html_url":"https://github.com/davegahn","followers_url":"https://api.github.com/users/davegahn/followers","following_url":"https://api.github.com/users/davegahn/following{/other_user}","gists_url":"https://api.github.com/users/davegahn/gists{/gist_id}","starred_url":"https://api.github.com/users/davegahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davegahn/subscriptions","organizations_url":"https://api.github.com/users/davegahn/orgs","repos_url":"https://api.github.com/users/davegahn/repos","events_url":"https://api.github.com/users/davegahn/events{/privacy}","received_events_url":"https://api.github.com/users/davegahn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davegahn/110324-code-and-magick","description":"Алексей Исаев","fork":true,"url":"https://api.github.com/repos/davegahn/110324-code-and-magick","forks_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/forks","keys_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/teams","hooks_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/events","assignees_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/tags","blobs_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/subscription","commits_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/merges","archive_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/downloads","issues_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/davegahn/110324-code-and-magick/deployments","created_at":"2016-10-07T14:21:00Z","updated_at":"2016-10-07T14:21:01Z","pushed_at":"2016-10-24T15:31:36Z","git_url":"git://github.com/davegahn/110324-code-and-magick.git","ssh_url":"git@github.com:davegahn/110324-code-and-magick.git","clone_url":"https://github.com/davegahn/110324-code-and-magick.git","svn_url":"https://github.com/davegahn/110324-code-and-magick","homepage":null,"size":1125,"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":"bd38027d4a7d444a9da3ef575af7b9a71d21fbe9","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":69997414,"name":"110324-code-and-magick","full_name":"htmlacademy-javascript/110324-code-and-magick","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/110324-code-and-magick","description":"Алексей Исаев","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick","forks_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/deployments","created_at":"2016-10-04T19:10:12Z","updated_at":"2016-10-07T14:34:35Z","pushed_at":"2016-10-24T15:31:36Z","git_url":"git://github.com/htmlacademy-javascript/110324-code-and-magick.git","ssh_url":"git@github.com:htmlacademy-javascript/110324-code-and-magick.git","clone_url":"https://github.com/htmlacademy-javascript/110324-code-and-magick.git","svn_url":"https://github.com/htmlacademy-javascript/110324-code-and-magick","homepage":"https://github.com/davegahn/110324-code-and-magick","size":1154,"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/110324-code-and-magick/pulls/6"},"html":{"href":"https://github.com/htmlacademy-javascript/110324-code-and-magick/pull/6"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/issues/6"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/110324-code-and-magick/statuses/f896e3846efa7adb806553096dbd93f8570f2f63"}}}}
{"actor":{"display_login":"demeshkin"}}