{"action":"created","comment":{"url":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/comments/225095610","pull_request_review_id":164617475,"id":225095610,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTA5NTYxMA==","diff_hunk":"@@ -1,40 +1,64 @@\n-'use strict';\n+\"use strict\";\n \n-const $tagsInput = document.getElementById('tags-input');\n-const $tagsList = document.getElementById('tags-list');\n-const tagsArr = ['1', 'super tag'];\n+const DEFAULT_TAGS = [\n+  {\n+    text: \"tag1\",\n+    key: Date.now() + 1\n+  },\n+  {\n+    text: \"same awesame tag\",\n+    key: Date.now() + 2\n+  }\n+];\n+\n+const $app = document.getElementById('app');\n+const $errorMassage = document.getElementsByClassName(\"error-massage\");\n+const $tagsList = document.getElementsByClassName(\"tags-list\");\n+const tagsArr = [\n+  [],\n+  [...DEFAULT_TAGS]\n+];\n+\n+$app.addEventListener('keyup',({key, target}) => {\n+  if (target.classList.value.indexOf('tags-input') !== -1) {\n+    const tag = target.value.trim();\n+    const indexElement = target.getAttribute('data-ind');\n+\n+    $errorMassage[indexElement].style.display = \"none\";\n+    \n+    if (key === \"Enter\" && tag) {\n+        target.value = \"\";\n \n-$tagsInput.addEventListener('keyup', ({key, target}) => {\n-  if (key === 'Enter' && target.value.trim()) {\n-    const $el = createTagElement(target.value);\n-    const isElementExist = tagsArr.includes(target.value);\n+        const isElementExist = tagsArr[indexElement].find(el => el.text === tag);\n \n-    if (!isElementExist) {\n-      $tagsList.appendChild($el);\n-      tagsArr.push(target.value);\n-      target.value = '';\n+        if (isElementExist) {\n+          $errorMassage[indexElement].style.display = \"block\";","path":"src/index.js","position":47,"original_position":47,"commit_id":"dd76b4ff4a87b015e43c4808997391699cce8014","original_commit_id":"dd76b4ff4a87b015e43c4808997391699cce8014","user":{"login":"dosandk","id":7078894,"node_id":"MDQ6VXNlcjcwNzg4OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7078894?v=4","gravatar_id":"","url":"https://api.github.com/users/dosandk","html_url":"https://github.com/dosandk","followers_url":"https://api.github.com/users/dosandk/followers","following_url":"https://api.github.com/users/dosandk/following{/other_user}","gists_url":"https://api.github.com/users/dosandk/gists{/gist_id}","starred_url":"https://api.github.com/users/dosandk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dosandk/subscriptions","organizations_url":"https://api.github.com/users/dosandk/orgs","repos_url":"https://api.github.com/users/dosandk/repos","events_url":"https://api.github.com/users/dosandk/events{/privacy}","received_events_url":"https://api.github.com/users/dosandk/received_events","type":"User","site_admin":false},"body":"hiding and showing of an element must be implemented via classes!\r\n👎 ","created_at":"2018-10-15T09:26:56Z","updated_at":"2018-10-15T09:27:58Z","html_url":"https://github.com/front-camp-2018/tags-input/pull/36#discussion_r225095610","pull_request_url":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/36","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/comments/225095610"},"html":{"href":"https://github.com/front-camp-2018/tags-input/pull/36#discussion_r225095610"},"pull_request":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/36","id":222416251,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNDE2MjUx","html_url":"https://github.com/front-camp-2018/tags-input/pull/36","diff_url":"https://github.com/front-camp-2018/tags-input/pull/36.diff","patch_url":"https://github.com/front-camp-2018/tags-input/pull/36.patch","issue_url":"https://api.github.com/repos/front-camp-2018/tags-input/issues/36","number":36,"state":"open","locked":false,"title":"Added more functionality","user":{"login":"rusjah","id":25596410,"node_id":"MDQ6VXNlcjI1NTk2NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/25596410?v=4","gravatar_id":"","url":"https://api.github.com/users/rusjah","html_url":"https://github.com/rusjah","followers_url":"https://api.github.com/users/rusjah/followers","following_url":"https://api.github.com/users/rusjah/following{/other_user}","gists_url":"https://api.github.com/users/rusjah/gists{/gist_id}","starred_url":"https://api.github.com/users/rusjah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rusjah/subscriptions","organizations_url":"https://api.github.com/users/rusjah/orgs","repos_url":"https://api.github.com/users/rusjah/repos","events_url":"https://api.github.com/users/rusjah/events{/privacy}","received_events_url":"https://api.github.com/users/rusjah/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-12T10:09:08Z","updated_at":"2018-10-15T09:27:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53166ec9e29551cfaa09823e9bdac1412399d8ea","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/36/commits","review_comments_url":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/36/comments","review_comment_url":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/comments{/number}","comments_url":"https://api.github.com/repos/front-camp-2018/tags-input/issues/36/comments","statuses_url":"https://api.github.com/repos/front-camp-2018/tags-input/statuses/dd76b4ff4a87b015e43c4808997391699cce8014","head":{"label":"rusjah:rgural","ref":"rgural","sha":"dd76b4ff4a87b015e43c4808997391699cce8014","user":{"login":"rusjah","id":25596410,"node_id":"MDQ6VXNlcjI1NTk2NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/25596410?v=4","gravatar_id":"","url":"https://api.github.com/users/rusjah","html_url":"https://github.com/rusjah","followers_url":"https://api.github.com/users/rusjah/followers","following_url":"https://api.github.com/users/rusjah/following{/other_user}","gists_url":"https://api.github.com/users/rusjah/gists{/gist_id}","starred_url":"https://api.github.com/users/rusjah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rusjah/subscriptions","organizations_url":"https://api.github.com/users/rusjah/orgs","repos_url":"https://api.github.com/users/rusjah/repos","events_url":"https://api.github.com/users/rusjah/events{/privacy}","received_events_url":"https://api.github.com/users/rusjah/received_events","type":"User","site_admin":false},"repo":{"id":152731463,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI3MzE0NjM=","name":"tags-input","full_name":"rusjah/tags-input","private":false,"owner":{"login":"rusjah","id":25596410,"node_id":"MDQ6VXNlcjI1NTk2NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/25596410?v=4","gravatar_id":"","url":"https://api.github.com/users/rusjah","html_url":"https://github.com/rusjah","followers_url":"https://api.github.com/users/rusjah/followers","following_url":"https://api.github.com/users/rusjah/following{/other_user}","gists_url":"https://api.github.com/users/rusjah/gists{/gist_id}","starred_url":"https://api.github.com/users/rusjah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rusjah/subscriptions","organizations_url":"https://api.github.com/users/rusjah/orgs","repos_url":"https://api.github.com/users/rusjah/repos","events_url":"https://api.github.com/users/rusjah/events{/privacy}","received_events_url":"https://api.github.com/users/rusjah/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rusjah/tags-input","description":null,"fork":true,"url":"https://api.github.com/repos/rusjah/tags-input","forks_url":"https://api.github.com/repos/rusjah/tags-input/forks","keys_url":"https://api.github.com/repos/rusjah/tags-input/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rusjah/tags-input/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rusjah/tags-input/teams","hooks_url":"https://api.github.com/repos/rusjah/tags-input/hooks","issue_events_url":"https://api.github.com/repos/rusjah/tags-input/issues/events{/number}","events_url":"https://api.github.com/repos/rusjah/tags-input/events","assignees_url":"https://api.github.com/repos/rusjah/tags-input/assignees{/user}","branches_url":"https://api.github.com/repos/rusjah/tags-input/branches{/branch}","tags_url":"https://api.github.com/repos/rusjah/tags-input/tags","blobs_url":"https://api.github.com/repos/rusjah/tags-input/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rusjah/tags-input/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rusjah/tags-input/git/refs{/sha}","trees_url":"https://api.github.com/repos/rusjah/tags-input/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rusjah/tags-input/statuses/{sha}","languages_url":"https://api.github.com/repos/rusjah/tags-input/languages","stargazers_url":"https://api.github.com/repos/rusjah/tags-input/stargazers","contributors_url":"https://api.github.com/repos/rusjah/tags-input/contributors","subscribers_url":"https://api.github.com/repos/rusjah/tags-input/subscribers","subscription_url":"https://api.github.com/repos/rusjah/tags-input/subscription","commits_url":"https://api.github.com/repos/rusjah/tags-input/commits{/sha}","git_commits_url":"https://api.github.com/repos/rusjah/tags-input/git/commits{/sha}","comments_url":"https://api.github.com/repos/rusjah/tags-input/comments{/number}","issue_comment_url":"https://api.github.com/repos/rusjah/tags-input/issues/comments{/number}","contents_url":"https://api.github.com/repos/rusjah/tags-input/contents/{+path}","compare_url":"https://api.github.com/repos/rusjah/tags-input/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rusjah/tags-input/merges","archive_url":"https://api.github.com/repos/rusjah/tags-input/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rusjah/tags-input/downloads","issues_url":"https://api.github.com/repos/rusjah/tags-input/issues{/number}","pulls_url":"https://api.github.com/repos/rusjah/tags-input/pulls{/number}","milestones_url":"https://api.github.com/repos/rusjah/tags-input/milestones{/number}","notifications_url":"https://api.github.com/repos/rusjah/tags-input/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rusjah/tags-input/labels{/name}","releases_url":"https://api.github.com/repos/rusjah/tags-input/releases{/id}","deployments_url":"https://api.github.com/repos/rusjah/tags-input/deployments","created_at":"2018-10-12T10:02:36Z","updated_at":"2018-10-12T10:02:38Z","pushed_at":"2018-10-12T10:05:39Z","git_url":"git://github.com/rusjah/tags-input.git","ssh_url":"git@github.com:rusjah/tags-input.git","clone_url":"https://github.com/rusjah/tags-input.git","svn_url":"https://github.com/rusjah/tags-input","homepage":null,"size":70,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"front-camp-2018:master","ref":"master","sha":"46bb57aef1ec0db5b77b4e1f1d6a4a71672a4c6f","user":{"login":"front-camp-2018","id":43757565,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNzU3NTY1","avatar_url":"https://avatars3.githubusercontent.com/u/43757565?v=4","gravatar_id":"","url":"https://api.github.com/users/front-camp-2018","html_url":"https://github.com/front-camp-2018","followers_url":"https://api.github.com/users/front-camp-2018/followers","following_url":"https://api.github.com/users/front-camp-2018/following{/other_user}","gists_url":"https://api.github.com/users/front-camp-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/front-camp-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/front-camp-2018/subscriptions","organizations_url":"https://api.github.com/users/front-camp-2018/orgs","repos_url":"https://api.github.com/users/front-camp-2018/repos","events_url":"https://api.github.com/users/front-camp-2018/events{/privacy}","received_events_url":"https://api.github.com/users/front-camp-2018/received_events","type":"Organization","site_admin":false},"repo":{"id":151557838,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE1NTc4Mzg=","name":"tags-input","full_name":"front-camp-2018/tags-input","private":false,"owner":{"login":"front-camp-2018","id":43757565,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNzU3NTY1","avatar_url":"https://avatars3.githubusercontent.com/u/43757565?v=4","gravatar_id":"","url":"https://api.github.com/users/front-camp-2018","html_url":"https://github.com/front-camp-2018","followers_url":"https://api.github.com/users/front-camp-2018/followers","following_url":"https://api.github.com/users/front-camp-2018/following{/other_user}","gists_url":"https://api.github.com/users/front-camp-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/front-camp-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/front-camp-2018/subscriptions","organizations_url":"https://api.github.com/users/front-camp-2018/orgs","repos_url":"https://api.github.com/users/front-camp-2018/repos","events_url":"https://api.github.com/users/front-camp-2018/events{/privacy}","received_events_url":"https://api.github.com/users/front-camp-2018/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/front-camp-2018/tags-input","description":null,"fork":false,"url":"https://api.github.com/repos/front-camp-2018/tags-input","forks_url":"https://api.github.com/repos/front-camp-2018/tags-input/forks","keys_url":"https://api.github.com/repos/front-camp-2018/tags-input/keys{/key_id}","collaborators_url":"https://api.github.com/repos/front-camp-2018/tags-input/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/front-camp-2018/tags-input/teams","hooks_url":"https://api.github.com/repos/front-camp-2018/tags-input/hooks","issue_events_url":"https://api.github.com/repos/front-camp-2018/tags-input/issues/events{/number}","events_url":"https://api.github.com/repos/front-camp-2018/tags-input/events","assignees_url":"https://api.github.com/repos/front-camp-2018/tags-input/assignees{/user}","branches_url":"https://api.github.com/repos/front-camp-2018/tags-input/branches{/branch}","tags_url":"https://api.github.com/repos/front-camp-2018/tags-input/tags","blobs_url":"https://api.github.com/repos/front-camp-2018/tags-input/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/front-camp-2018/tags-input/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/front-camp-2018/tags-input/git/refs{/sha}","trees_url":"https://api.github.com/repos/front-camp-2018/tags-input/git/trees{/sha}","statuses_url":"https://api.github.com/repos/front-camp-2018/tags-input/statuses/{sha}","languages_url":"https://api.github.com/repos/front-camp-2018/tags-input/languages","stargazers_url":"https://api.github.com/repos/front-camp-2018/tags-input/stargazers","contributors_url":"https://api.github.com/repos/front-camp-2018/tags-input/contributors","subscribers_url":"https://api.github.com/repos/front-camp-2018/tags-input/subscribers","subscription_url":"https://api.github.com/repos/front-camp-2018/tags-input/subscription","commits_url":"https://api.github.com/repos/front-camp-2018/tags-input/commits{/sha}","git_commits_url":"https://api.github.com/repos/front-camp-2018/tags-input/git/commits{/sha}","comments_url":"https://api.github.com/repos/front-camp-2018/tags-input/comments{/number}","issue_comment_url":"https://api.github.com/repos/front-camp-2018/tags-input/issues/comments{/number}","contents_url":"https://api.github.com/repos/front-camp-2018/tags-input/contents/{+path}","compare_url":"https://api.github.com/repos/front-camp-2018/tags-input/compare/{base}...{head}","merges_url":"https://api.github.com/repos/front-camp-2018/tags-input/merges","archive_url":"https://api.github.com/repos/front-camp-2018/tags-input/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/front-camp-2018/tags-input/downloads","issues_url":"https://api.github.com/repos/front-camp-2018/tags-input/issues{/number}","pulls_url":"https://api.github.com/repos/front-camp-2018/tags-input/pulls{/number}","milestones_url":"https://api.github.com/repos/front-camp-2018/tags-input/milestones{/number}","notifications_url":"https://api.github.com/repos/front-camp-2018/tags-input/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/front-camp-2018/tags-input/labels{/name}","releases_url":"https://api.github.com/repos/front-camp-2018/tags-input/releases{/id}","deployments_url":"https://api.github.com/repos/front-camp-2018/tags-input/deployments","created_at":"2018-10-04T10:57:46Z","updated_at":"2018-10-09T17:28:57Z","pushed_at":"2018-10-12T21:15:10Z","git_url":"git://github.com/front-camp-2018/tags-input.git","ssh_url":"git@github.com:front-camp-2018/tags-input.git","clone_url":"https://github.com/front-camp-2018/tags-input.git","svn_url":"https://github.com/front-camp-2018/tags-input","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":42,"license":null,"forks":42,"open_issues":42,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/36"},"html":{"href":"https://github.com/front-camp-2018/tags-input/pull/36"},"issue":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/issues/36"},"comments":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/front-camp-2018/tags-input/statuses/dd76b4ff4a87b015e43c4808997391699cce8014"}},"author_association":"NONE"}}
{"actor":{"display_login":"dosandk"}}