{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/comments/169657229","pull_request_review_id":98217901,"id":169657229,"diff_hunk":"@@ -0,0 +1,74 @@\n+'use strict';\n+\n+(function () {\n+\n+  var MAP_CENTER_X = 600;\n+  var MAP_CENTER_Y = 375;\n+  // var MAIN_PIN_SHIFT_X = 32; Пригодится позже\n+  var MAIN_PIN_SHIFT_Y = 42;\n+\n+  var map = document.querySelector('.map');\n+  var mapPins = map.querySelector('.map__pins');\n+  var mainPin = mapPins.querySelector('.map__pin--main');\n+  var form = document.querySelector('.notice__form');\n+  var fieldsets = form.querySelectorAll('fieldset');\n+  var type = form.querySelector('#type');\n+  var rooms = form.querySelector('#room_number');\n+  var reset = form.querySelector('.form__reset');\n+  var address = form.querySelector('#address');\n+\n+  var activateMap = function () {\n+    map.classList.remove('map--faded');\n+  };\n+\n+  var removeAllMapPins = function () {\n+    while (mapPins.lastElementChild.classList.contains('map__pin--main') === false) {\n+      mapPins.removeChild(mapPins.lastChild);\n+    }\n+  };\n+\n+  var toggleForm = function () {\n+    form.classList.toggle('notice__form--disabled');\n+    fieldsets.forEach(function (item) {\n+      item.disabled = !item.disabled;\n+    });\n+  };\n+\n+  var setAddress = function (evt) {\n+    var mainPinCoords = (evt.clientX) + ', ' + (evt.clientY + MAIN_PIN_SHIFT_Y);\n+    address.setAttribute('value', mainPinCoords);\n+  };\n+\n+  var behavior = {\n+\n+    onMainPinMouseup: function (evt) {\n+      activateMap();\n+      toggleForm();\n+      setAddress(evt);\n+      window.renderMapPins();\n+      mainPin.removeEventListener('mouseup', window.behavior.onMainPinMouseup); // Удаляем обработчик события\n+      type.addEventListener('change', window.formValidation.onTypeChange); // Вешаем обработчик изменения типа жилья\n+      form.addEventListener('change', window.formValidation.onTimeChange); // Вешаем обработчик изменения времени\n+      rooms.addEventListener('change', window.formValidation.onRoomsChange); // Вешаем обработчик изменения кол-ва комнат\n+      reset.addEventListener('click', window.behavior.onResetButtonClick); // Вешаем обработчик на кнопку сброса формы\n+    },\n+\n+    onResetButtonClick: function () {\n+      form.reset();\n+      address.setAttribute('value', MAP_CENTER_X + ', ' + MAP_CENTER_Y);\n+      map.classList.add('map--faded');\n+      toggleForm();\n+      removeAllMapPins();\n+      window.removeMapCard();\n+      reset.removeEventListener('click', window.behavior.onResetButtonClick);\n+      type.removeEventListener('change', window.formValidation.onTypeChange);\n+      form.removeEventListener('change', window.formValidation.onTimeChange);\n+      rooms.removeEventListener('change', window.formValidation.onRoomsChange);\n+      mainPin.addEventListener('mouseup', window.behavior.onMainPinMouseup);\n+    }\n+  };\n+\n+  // Export\n+  window.behavior = behavior;\n+\n+})();","path":"js/behavior.js","position":74,"original_position":74,"commit_id":"18d477fb719bd8ba1fbcda678ee16608232fb5ed","original_commit_id":"18d477fb719bd8ba1fbcda678ee16608232fb5ed","user":{"login":"juwain","id":928081,"avatar_url":"https://avatars3.githubusercontent.com/u/928081?v=4","gravatar_id":"","url":"https://api.github.com/users/juwain","html_url":"https://github.com/juwain","followers_url":"https://api.github.com/users/juwain/followers","following_url":"https://api.github.com/users/juwain/following{/other_user}","gists_url":"https://api.github.com/users/juwain/gists{/gist_id}","starred_url":"https://api.github.com/users/juwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juwain/subscriptions","organizations_url":"https://api.github.com/users/juwain/orgs","repos_url":"https://api.github.com/users/juwain/repos","events_url":"https://api.github.com/users/juwain/events{/privacy}","received_events_url":"https://api.github.com/users/juwain/received_events","type":"User","site_admin":false},"body":"Лучше отделить мух от котлет.","created_at":"2018-02-21T14:41:40Z","updated_at":"2018-02-21T14:41:40Z","html_url":"https://github.com/htmlacademy-javascript/82296-keksobooking/pull/5#discussion_r169657229","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/5","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/comments/169657229"},"html":{"href":"https://github.com/htmlacademy-javascript/82296-keksobooking/pull/5#discussion_r169657229"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/5"}},"in_reply_to_id":169649147},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/5","id":170444649,"html_url":"https://github.com/htmlacademy-javascript/82296-keksobooking/pull/5","diff_url":"https://github.com/htmlacademy-javascript/82296-keksobooking/pull/5.diff","patch_url":"https://github.com/htmlacademy-javascript/82296-keksobooking/pull/5.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/issues/5","number":5,"state":"open","locked":false,"title":"Личный проект: модуляция","user":{"login":"voodoorg","id":33215999,"avatar_url":"https://avatars1.githubusercontent.com/u/33215999?v=4","gravatar_id":"","url":"https://api.github.com/users/voodoorg","html_url":"https://github.com/voodoorg","followers_url":"https://api.github.com/users/voodoorg/followers","following_url":"https://api.github.com/users/voodoorg/following{/other_user}","gists_url":"https://api.github.com/users/voodoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/voodoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voodoorg/subscriptions","organizations_url":"https://api.github.com/users/voodoorg/orgs","repos_url":"https://api.github.com/users/voodoorg/repos","events_url":"https://api.github.com/users/voodoorg/events{/privacy}","received_events_url":"https://api.github.com/users/voodoorg/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Личный проект: модуляция](https://up.htmlacademy.ru/javascript/12/user/82296/tasks/18)","created_at":"2018-02-21T11:36:54Z","updated_at":"2018-02-21T14:41:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"778757839904f2cadfb9a1a197d7205641bb7278","assignee":{"login":"juwain","id":928081,"avatar_url":"https://avatars3.githubusercontent.com/u/928081?v=4","gravatar_id":"","url":"https://api.github.com/users/juwain","html_url":"https://github.com/juwain","followers_url":"https://api.github.com/users/juwain/followers","following_url":"https://api.github.com/users/juwain/following{/other_user}","gists_url":"https://api.github.com/users/juwain/gists{/gist_id}","starred_url":"https://api.github.com/users/juwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juwain/subscriptions","organizations_url":"https://api.github.com/users/juwain/orgs","repos_url":"https://api.github.com/users/juwain/repos","events_url":"https://api.github.com/users/juwain/events{/privacy}","received_events_url":"https://api.github.com/users/juwain/received_events","type":"User","site_admin":false},"assignees":[{"login":"juwain","id":928081,"avatar_url":"https://avatars3.githubusercontent.com/u/928081?v=4","gravatar_id":"","url":"https://api.github.com/users/juwain","html_url":"https://github.com/juwain","followers_url":"https://api.github.com/users/juwain/followers","following_url":"https://api.github.com/users/juwain/following{/other_user}","gists_url":"https://api.github.com/users/juwain/gists{/gist_id}","starred_url":"https://api.github.com/users/juwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juwain/subscriptions","organizations_url":"https://api.github.com/users/juwain/orgs","repos_url":"https://api.github.com/users/juwain/repos","events_url":"https://api.github.com/users/juwain/events{/privacy}","received_events_url":"https://api.github.com/users/juwain/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/5/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/5/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/issues/5/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/statuses/18d477fb719bd8ba1fbcda678ee16608232fb5ed","head":{"label":"voodoorg:module5-task1","ref":"module5-task1","sha":"18d477fb719bd8ba1fbcda678ee16608232fb5ed","user":{"login":"voodoorg","id":33215999,"avatar_url":"https://avatars1.githubusercontent.com/u/33215999?v=4","gravatar_id":"","url":"https://api.github.com/users/voodoorg","html_url":"https://github.com/voodoorg","followers_url":"https://api.github.com/users/voodoorg/followers","following_url":"https://api.github.com/users/voodoorg/following{/other_user}","gists_url":"https://api.github.com/users/voodoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/voodoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voodoorg/subscriptions","organizations_url":"https://api.github.com/users/voodoorg/orgs","repos_url":"https://api.github.com/users/voodoorg/repos","events_url":"https://api.github.com/users/voodoorg/events{/privacy}","received_events_url":"https://api.github.com/users/voodoorg/received_events","type":"User","site_admin":false},"repo":{"id":118706505,"name":"82296-keksobooking","full_name":"voodoorg/82296-keksobooking","owner":{"login":"voodoorg","id":33215999,"avatar_url":"https://avatars1.githubusercontent.com/u/33215999?v=4","gravatar_id":"","url":"https://api.github.com/users/voodoorg","html_url":"https://github.com/voodoorg","followers_url":"https://api.github.com/users/voodoorg/followers","following_url":"https://api.github.com/users/voodoorg/following{/other_user}","gists_url":"https://api.github.com/users/voodoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/voodoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voodoorg/subscriptions","organizations_url":"https://api.github.com/users/voodoorg/orgs","repos_url":"https://api.github.com/users/voodoorg/repos","events_url":"https://api.github.com/users/voodoorg/events{/privacy}","received_events_url":"https://api.github.com/users/voodoorg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/voodoorg/82296-keksobooking","description":"Илья Саталкин","fork":true,"url":"https://api.github.com/repos/voodoorg/82296-keksobooking","forks_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/forks","keys_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/teams","hooks_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/hooks","issue_events_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/issues/events{/number}","events_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/events","assignees_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/assignees{/user}","branches_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/branches{/branch}","tags_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/tags","blobs_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/git/refs{/sha}","trees_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/statuses/{sha}","languages_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/languages","stargazers_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/stargazers","contributors_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/contributors","subscribers_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/subscribers","subscription_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/subscription","commits_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/commits{/sha}","git_commits_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/git/commits{/sha}","comments_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/comments{/number}","issue_comment_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/issues/comments{/number}","contents_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/contents/{+path}","compare_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/merges","archive_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/downloads","issues_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/issues{/number}","pulls_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/pulls{/number}","milestones_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/milestones{/number}","notifications_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/labels{/name}","releases_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/releases{/id}","deployments_url":"https://api.github.com/repos/voodoorg/82296-keksobooking/deployments","created_at":"2018-01-24T03:28:57Z","updated_at":"2018-02-20T21:37:02Z","pushed_at":"2018-02-21T11:35:43Z","git_url":"git://github.com/voodoorg/82296-keksobooking.git","ssh_url":"git@github.com:voodoorg/82296-keksobooking.git","clone_url":"https://github.com/voodoorg/82296-keksobooking.git","svn_url":"https://github.com/voodoorg/82296-keksobooking","homepage":null,"size":780,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"htmlacademy-javascript:master","ref":"master","sha":"28258b811bfc03129f9ab3cb7eebdbad725c437f","user":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","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":118705936,"name":"82296-keksobooking","full_name":"htmlacademy-javascript/82296-keksobooking","owner":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","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/82296-keksobooking","description":"Илья Саталкин","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking","forks_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/deployments","created_at":"2018-01-24T03:23:20Z","updated_at":"2018-02-20T21:32:39Z","pushed_at":"2018-02-21T11:36:55Z","git_url":"git://github.com/htmlacademy-javascript/82296-keksobooking.git","ssh_url":"git@github.com:htmlacademy-javascript/82296-keksobooking.git","clone_url":"https://github.com/htmlacademy-javascript/82296-keksobooking.git","svn_url":"https://github.com/htmlacademy-javascript/82296-keksobooking","homepage":"https://github.com/voodoorg/82296-keksobooking","size":772,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/5"},"html":{"href":"https://github.com/htmlacademy-javascript/82296-keksobooking/pull/5"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/issues/5"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/82296-keksobooking/statuses/18d477fb719bd8ba1fbcda678ee16608232fb5ed"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"juwain"}}