{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/comments/167391507","pull_request_review_id":95614917,"id":167391507,"diff_hunk":"@@ -323,9 +356,73 @@\n   };\n \n   var adverts = generateAdArray(AD_COUNT);\n-  var firstCard = createAdvert(adverts[0]);\n+  var fragment = createPins(adverts);\n+  var advertCard;\n+\n+  /**\n+   * Get active map and form\n+   */\n+  var enableMap = function () {\n+    mapPins.appendChild(fragment);\n+\n+    map.classList.remove('map--faded');\n+    noticeForm.classList.remove('notice__form--disabled');\n+\n+    setDisableField(noticeFields, false);\n+  };\n+\n+  /**\n+   * Enable or disable fields for users\n+   * @param {array} fields\n+   * @param {boolean} isDisabled\n+   */\n+  var setDisableField = function (fields, isDisabled) {\n+    fields.forEach(function (set) {\n+      set.disabled = isDisabled;\n+    });\n+  };\n+\n+  /**\n+   * Render pop-up a certain pressed pin\n+   * @param {Object} evt\n+   * @param {Object} advert\n+   */\n+  var pinClickHandler = function (evt, advert) {\n+    closePin();\n+\n+    advertCard = createAdvert(advert);\n+    map.appendChild(advertCard);\n+\n+    advertCard.querySelector('.popup__close').addEventListener('click', closePin);\n+  };\n+\n+  /**\n+   * Check for a specific (ESC) button click\n+   * @param {Object} evt\n+   */\n+  var keydownEscapeHandler = function (evt) {\n+    if (evt.keyCode === KeyCodes.ESC) {\n+      closePin();\n+    }\n+  };\n+\n+  /**\n+   * Remove active advert of currently pin\n+   */\n+  var closePin = function () {\n+    if (advertCard) {\n+      map.removeChild(advertCard);\n+      advertCard = null;\n+    }\n+  };\n+\n+  setDisableField(noticeFields, true);\n+  fillAdressField();\n+\n+  mapPins.addEventListener('keydown', keydownEscapeHandler);","path":"js/map.js","position":130,"original_position":130,"commit_id":"b01f37dd066c97dc045230955d01ee135bfb7a6c","original_commit_id":"b01f37dd066c97dc045230955d01ee135bfb7a6c","user":{"login":"fyvfyv","id":3251438,"avatar_url":"https://avatars2.githubusercontent.com/u/3251438?v=4","gravatar_id":"","url":"https://api.github.com/users/fyvfyv","html_url":"https://github.com/fyvfyv","followers_url":"https://api.github.com/users/fyvfyv/followers","following_url":"https://api.github.com/users/fyvfyv/following{/other_user}","gists_url":"https://api.github.com/users/fyvfyv/gists{/gist_id}","starred_url":"https://api.github.com/users/fyvfyv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyvfyv/subscriptions","organizations_url":"https://api.github.com/users/fyvfyv/orgs","repos_url":"https://api.github.com/users/fyvfyv/repos","events_url":"https://api.github.com/users/fyvfyv/events{/privacy}","received_events_url":"https://api.github.com/users/fyvfyv/received_events","type":"User","site_admin":false},"body":"Открыл карточку. Ткнул в любую часть кроме карты мышкой. Нажал esc и карточка не закрывается. Надо пофиксить","created_at":"2018-02-10T06:59:54Z","updated_at":"2018-02-10T07:03:23Z","html_url":"https://github.com/htmlacademy-javascript/502911-keksobooking/pull/3#discussion_r167391507","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/3","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/comments/167391507"},"html":{"href":"https://github.com/htmlacademy-javascript/502911-keksobooking/pull/3#discussion_r167391507"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/3","id":168110883,"html_url":"https://github.com/htmlacademy-javascript/502911-keksobooking/pull/3","diff_url":"https://github.com/htmlacademy-javascript/502911-keksobooking/pull/3.diff","patch_url":"https://github.com/htmlacademy-javascript/502911-keksobooking/pull/3.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/issues/3","number":3,"state":"open","locked":false,"title":"Личный проект: подробности","user":{"login":"TchernyavskyDaniil","id":29048318,"avatar_url":"https://avatars2.githubusercontent.com/u/29048318?v=4","gravatar_id":"","url":"https://api.github.com/users/TchernyavskyDaniil","html_url":"https://github.com/TchernyavskyDaniil","followers_url":"https://api.github.com/users/TchernyavskyDaniil/followers","following_url":"https://api.github.com/users/TchernyavskyDaniil/following{/other_user}","gists_url":"https://api.github.com/users/TchernyavskyDaniil/gists{/gist_id}","starred_url":"https://api.github.com/users/TchernyavskyDaniil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TchernyavskyDaniil/subscriptions","organizations_url":"https://api.github.com/users/TchernyavskyDaniil/orgs","repos_url":"https://api.github.com/users/TchernyavskyDaniil/repos","events_url":"https://api.github.com/users/TchernyavskyDaniil/events{/privacy}","received_events_url":"https://api.github.com/users/TchernyavskyDaniil/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Личный проект: подробности](https://up.htmlacademy.ru/javascript/12/user/502911/tasks/13)\n\n:boom: https://htmlacademy-javascript.github.io/502911-keksobooking/3/","created_at":"2018-02-08T22:59:51Z","updated_at":"2018-02-10T07:03:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea4efabef7595bd4c288d7959e88e71d1ca25274","assignee":{"login":"fyvfyv","id":3251438,"avatar_url":"https://avatars2.githubusercontent.com/u/3251438?v=4","gravatar_id":"","url":"https://api.github.com/users/fyvfyv","html_url":"https://github.com/fyvfyv","followers_url":"https://api.github.com/users/fyvfyv/followers","following_url":"https://api.github.com/users/fyvfyv/following{/other_user}","gists_url":"https://api.github.com/users/fyvfyv/gists{/gist_id}","starred_url":"https://api.github.com/users/fyvfyv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyvfyv/subscriptions","organizations_url":"https://api.github.com/users/fyvfyv/orgs","repos_url":"https://api.github.com/users/fyvfyv/repos","events_url":"https://api.github.com/users/fyvfyv/events{/privacy}","received_events_url":"https://api.github.com/users/fyvfyv/received_events","type":"User","site_admin":false},"assignees":[{"login":"fyvfyv","id":3251438,"avatar_url":"https://avatars2.githubusercontent.com/u/3251438?v=4","gravatar_id":"","url":"https://api.github.com/users/fyvfyv","html_url":"https://github.com/fyvfyv","followers_url":"https://api.github.com/users/fyvfyv/followers","following_url":"https://api.github.com/users/fyvfyv/following{/other_user}","gists_url":"https://api.github.com/users/fyvfyv/gists{/gist_id}","starred_url":"https://api.github.com/users/fyvfyv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyvfyv/subscriptions","organizations_url":"https://api.github.com/users/fyvfyv/orgs","repos_url":"https://api.github.com/users/fyvfyv/repos","events_url":"https://api.github.com/users/fyvfyv/events{/privacy}","received_events_url":"https://api.github.com/users/fyvfyv/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/3/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/3/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/issues/3/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/statuses/b01f37dd066c97dc045230955d01ee135bfb7a6c","head":{"label":"TchernyavskyDaniil:module4-task1","ref":"module4-task1","sha":"b01f37dd066c97dc045230955d01ee135bfb7a6c","user":{"login":"TchernyavskyDaniil","id":29048318,"avatar_url":"https://avatars2.githubusercontent.com/u/29048318?v=4","gravatar_id":"","url":"https://api.github.com/users/TchernyavskyDaniil","html_url":"https://github.com/TchernyavskyDaniil","followers_url":"https://api.github.com/users/TchernyavskyDaniil/followers","following_url":"https://api.github.com/users/TchernyavskyDaniil/following{/other_user}","gists_url":"https://api.github.com/users/TchernyavskyDaniil/gists{/gist_id}","starred_url":"https://api.github.com/users/TchernyavskyDaniil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TchernyavskyDaniil/subscriptions","organizations_url":"https://api.github.com/users/TchernyavskyDaniil/orgs","repos_url":"https://api.github.com/users/TchernyavskyDaniil/repos","events_url":"https://api.github.com/users/TchernyavskyDaniil/events{/privacy}","received_events_url":"https://api.github.com/users/TchernyavskyDaniil/received_events","type":"User","site_admin":false},"repo":{"id":118654772,"name":"502911-keksobooking","full_name":"TchernyavskyDaniil/502911-keksobooking","owner":{"login":"TchernyavskyDaniil","id":29048318,"avatar_url":"https://avatars2.githubusercontent.com/u/29048318?v=4","gravatar_id":"","url":"https://api.github.com/users/TchernyavskyDaniil","html_url":"https://github.com/TchernyavskyDaniil","followers_url":"https://api.github.com/users/TchernyavskyDaniil/followers","following_url":"https://api.github.com/users/TchernyavskyDaniil/following{/other_user}","gists_url":"https://api.github.com/users/TchernyavskyDaniil/gists{/gist_id}","starred_url":"https://api.github.com/users/TchernyavskyDaniil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TchernyavskyDaniil/subscriptions","organizations_url":"https://api.github.com/users/TchernyavskyDaniil/orgs","repos_url":"https://api.github.com/users/TchernyavskyDaniil/repos","events_url":"https://api.github.com/users/TchernyavskyDaniil/events{/privacy}","received_events_url":"https://api.github.com/users/TchernyavskyDaniil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TchernyavskyDaniil/502911-keksobooking","description":"Даниил Чернявский","fork":true,"url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking","forks_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/forks","keys_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/teams","hooks_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/hooks","issue_events_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/issues/events{/number}","events_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/events","assignees_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/assignees{/user}","branches_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/branches{/branch}","tags_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/tags","blobs_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/git/refs{/sha}","trees_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/statuses/{sha}","languages_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/languages","stargazers_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/stargazers","contributors_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/contributors","subscribers_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/subscribers","subscription_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/subscription","commits_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/commits{/sha}","git_commits_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/git/commits{/sha}","comments_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/comments{/number}","issue_comment_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/issues/comments{/number}","contents_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/contents/{+path}","compare_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/merges","archive_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/downloads","issues_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/issues{/number}","pulls_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/pulls{/number}","milestones_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/milestones{/number}","notifications_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/labels{/name}","releases_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/releases{/id}","deployments_url":"https://api.github.com/repos/TchernyavskyDaniil/502911-keksobooking/deployments","created_at":"2018-01-23T18:56:43Z","updated_at":"2018-01-23T18:56:44Z","pushed_at":"2018-02-09T21:31:53Z","git_url":"git://github.com/TchernyavskyDaniil/502911-keksobooking.git","ssh_url":"git@github.com:TchernyavskyDaniil/502911-keksobooking.git","clone_url":"https://github.com/TchernyavskyDaniil/502911-keksobooking.git","svn_url":"https://github.com/TchernyavskyDaniil/502911-keksobooking","homepage":null,"size":795,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"414acc370b427708261e91ef5d96745d916698e9","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":118654701,"name":"502911-keksobooking","full_name":"htmlacademy-javascript/502911-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/502911-keksobooking","description":"Даниил Чернявский","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking","forks_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/deployments","created_at":"2018-01-23T18:56:06Z","updated_at":"2018-01-23T19:11:59Z","pushed_at":"2018-02-10T06:51:26Z","git_url":"git://github.com/htmlacademy-javascript/502911-keksobooking.git","ssh_url":"git@github.com:htmlacademy-javascript/502911-keksobooking.git","clone_url":"https://github.com/htmlacademy-javascript/502911-keksobooking.git","svn_url":"https://github.com/htmlacademy-javascript/502911-keksobooking","homepage":"https://github.com/TchernyavskyDaniil/502911-keksobooking","size":812,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"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/502911-keksobooking/pulls/3"},"html":{"href":"https://github.com/htmlacademy-javascript/502911-keksobooking/pull/3"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/issues/3"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/502911-keksobooking/statuses/b01f37dd066c97dc045230955d01ee135bfb7a6c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"fyvfyv"}}