{"action":"created","comment":{"url":"https://api.github.com/repos/hmrc/assets-frontend/pulls/comments/90463759","pull_request_review_id":10981758,"id":90463759,"diff_hunk":"@@ -140,14 +140,16 @@ var updateInput = function (title, value) {\n };\n \n /**\n- * Allow auto complete to control and pass over the .value of your suggestion to another optional input\n+ * Allow auto complete to control and pass over the .value of your suggestion to one or more optional inputs\n  * specified on creation of the autoComplete\n+ * if the input is a select, pass the value, otherwise if there is a suggestionDisplayFormat, use that\n  * @param value\n  */\n var updateTargetInput = function (value) {\n-  if ($targetInput) {\n-    $targetInput.val(value);\n-  }\n+  var formattedString = (typeof suggestionDisplayFormat === 'function') ? suggestionDisplayFormat('',value) : value;\n+  $.each($targetInputs, function (index, targetEl) {\n+    $(targetEl).val($(targetEl).prop('tagName') === \"SELECT\" ? value : formattedString);","path":"assets/javascripts/modules/autoComplete.js","position":37,"original_position":37,"commit_id":"4beff9f18ba41899b13291dcee10926738eca3e5","original_commit_id":"4beff9f18ba41899b13291dcee10926738eca3e5","user":{"login":"feedmypixel","id":2305016,"avatar_url":"https://avatars.githubusercontent.com/u/2305016?v=3","gravatar_id":"","url":"https://api.github.com/users/feedmypixel","html_url":"https://github.com/feedmypixel","followers_url":"https://api.github.com/users/feedmypixel/followers","following_url":"https://api.github.com/users/feedmypixel/following{/other_user}","gists_url":"https://api.github.com/users/feedmypixel/gists{/gist_id}","starred_url":"https://api.github.com/users/feedmypixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedmypixel/subscriptions","organizations_url":"https://api.github.com/users/feedmypixel/orgs","repos_url":"https://api.github.com/users/feedmypixel/repos","events_url":"https://api.github.com/users/feedmypixel/events{/privacy}","received_events_url":"https://api.github.com/users/feedmypixel/received_events","type":"User","site_admin":false},"body":"`$(targetEl)` in some use cases will be wrapping a jQuery object here. `getTargetInput($elem)` and `$targetInputElem` provide jQuery elements to the `$targetElements` variable.","created_at":"2016-12-01T15:03:20Z","updated_at":"2016-12-01T15:03:25Z","html_url":"https://github.com/hmrc/assets-frontend/pull/725#discussion_r90463759","pull_request_url":"https://api.github.com/repos/hmrc/assets-frontend/pulls/725","_links":{"self":{"href":"https://api.github.com/repos/hmrc/assets-frontend/pulls/comments/90463759"},"html":{"href":"https://github.com/hmrc/assets-frontend/pull/725#discussion_r90463759"},"pull_request":{"href":"https://api.github.com/repos/hmrc/assets-frontend/pulls/725"}}},"pull_request":{"url":"https://api.github.com/repos/hmrc/assets-frontend/pulls/725","id":95888686,"html_url":"https://github.com/hmrc/assets-frontend/pull/725","diff_url":"https://github.com/hmrc/assets-frontend/pull/725.diff","patch_url":"https://github.com/hmrc/assets-frontend/pull/725.patch","issue_url":"https://api.github.com/repos/hmrc/assets-frontend/issues/725","number":725,"state":"open","locked":false,"title":"extend autocomplete to allow multiple data-target-elems to be declared","user":{"login":"automaticdreams","id":4093688,"avatar_url":"https://avatars.githubusercontent.com/u/4093688?v=3","gravatar_id":"","url":"https://api.github.com/users/automaticdreams","html_url":"https://github.com/automaticdreams","followers_url":"https://api.github.com/users/automaticdreams/followers","following_url":"https://api.github.com/users/automaticdreams/following{/other_user}","gists_url":"https://api.github.com/users/automaticdreams/gists{/gist_id}","starred_url":"https://api.github.com/users/automaticdreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automaticdreams/subscriptions","organizations_url":"https://api.github.com/users/automaticdreams/orgs","repos_url":"https://api.github.com/users/automaticdreams/repos","events_url":"https://api.github.com/users/automaticdreams/events{/privacy}","received_events_url":"https://api.github.com/users/automaticdreams/received_events","type":"User","site_admin":false},"body":"![autocomplete-before](https://cloud.githubusercontent.com/assets/4093688/20753376/00f794f8-b6fe-11e6-9eae-0452e60b1c5c.gif)\r\nbecause the country code is not displayed on the screen, a user does not know whether to enter it as part of the telephone number.\r\nBy displaying an additional input, that is updated on autoComplete, a user is clear that the countryCode does not need to be added\r\nExtending the data-target-elem to allow more than one element to update makes this further extendable if required\r\n![autocomplete-after](https://cloud.githubusercontent.com/assets/4093688/20753516/a815d024-b6fe-11e6-96c8-cd0716d09b6a.gif)\r\n\r\n","created_at":"2016-11-30T13:13:08Z","updated_at":"2016-12-01T15:03:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddc6fbf27349df2c70aefe4b567b93a1351b153a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmrc/assets-frontend/pulls/725/commits","review_comments_url":"https://api.github.com/repos/hmrc/assets-frontend/pulls/725/comments","review_comment_url":"https://api.github.com/repos/hmrc/assets-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmrc/assets-frontend/issues/725/comments","statuses_url":"https://api.github.com/repos/hmrc/assets-frontend/statuses/4beff9f18ba41899b13291dcee10926738eca3e5","head":{"label":"automaticdreams:GG-1615","ref":"GG-1615","sha":"4beff9f18ba41899b13291dcee10926738eca3e5","user":{"login":"automaticdreams","id":4093688,"avatar_url":"https://avatars.githubusercontent.com/u/4093688?v=3","gravatar_id":"","url":"https://api.github.com/users/automaticdreams","html_url":"https://github.com/automaticdreams","followers_url":"https://api.github.com/users/automaticdreams/followers","following_url":"https://api.github.com/users/automaticdreams/following{/other_user}","gists_url":"https://api.github.com/users/automaticdreams/gists{/gist_id}","starred_url":"https://api.github.com/users/automaticdreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automaticdreams/subscriptions","organizations_url":"https://api.github.com/users/automaticdreams/orgs","repos_url":"https://api.github.com/users/automaticdreams/repos","events_url":"https://api.github.com/users/automaticdreams/events{/privacy}","received_events_url":"https://api.github.com/users/automaticdreams/received_events","type":"User","site_admin":false},"repo":{"id":74482130,"name":"assets-frontend","full_name":"automaticdreams/assets-frontend","owner":{"login":"automaticdreams","id":4093688,"avatar_url":"https://avatars.githubusercontent.com/u/4093688?v=3","gravatar_id":"","url":"https://api.github.com/users/automaticdreams","html_url":"https://github.com/automaticdreams","followers_url":"https://api.github.com/users/automaticdreams/followers","following_url":"https://api.github.com/users/automaticdreams/following{/other_user}","gists_url":"https://api.github.com/users/automaticdreams/gists{/gist_id}","starred_url":"https://api.github.com/users/automaticdreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automaticdreams/subscriptions","organizations_url":"https://api.github.com/users/automaticdreams/orgs","repos_url":"https://api.github.com/users/automaticdreams/repos","events_url":"https://api.github.com/users/automaticdreams/events{/privacy}","received_events_url":"https://api.github.com/users/automaticdreams/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/automaticdreams/assets-frontend","description":"Shared static assets for frontends on the Multichannel Digital Tax Platform - http://hmrc.github.io/assets-frontend","fork":true,"url":"https://api.github.com/repos/automaticdreams/assets-frontend","forks_url":"https://api.github.com/repos/automaticdreams/assets-frontend/forks","keys_url":"https://api.github.com/repos/automaticdreams/assets-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/automaticdreams/assets-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/automaticdreams/assets-frontend/teams","hooks_url":"https://api.github.com/repos/automaticdreams/assets-frontend/hooks","issue_events_url":"https://api.github.com/repos/automaticdreams/assets-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/automaticdreams/assets-frontend/events","assignees_url":"https://api.github.com/repos/automaticdreams/assets-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/automaticdreams/assets-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/automaticdreams/assets-frontend/tags","blobs_url":"https://api.github.com/repos/automaticdreams/assets-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/automaticdreams/assets-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/automaticdreams/assets-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/automaticdreams/assets-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/automaticdreams/assets-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/automaticdreams/assets-frontend/languages","stargazers_url":"https://api.github.com/repos/automaticdreams/assets-frontend/stargazers","contributors_url":"https://api.github.com/repos/automaticdreams/assets-frontend/contributors","subscribers_url":"https://api.github.com/repos/automaticdreams/assets-frontend/subscribers","subscription_url":"https://api.github.com/repos/automaticdreams/assets-frontend/subscription","commits_url":"https://api.github.com/repos/automaticdreams/assets-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/automaticdreams/assets-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/automaticdreams/assets-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/automaticdreams/assets-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/automaticdreams/assets-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/automaticdreams/assets-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/automaticdreams/assets-frontend/merges","archive_url":"https://api.github.com/repos/automaticdreams/assets-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/automaticdreams/assets-frontend/downloads","issues_url":"https://api.github.com/repos/automaticdreams/assets-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/automaticdreams/assets-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/automaticdreams/assets-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/automaticdreams/assets-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/automaticdreams/assets-frontend/labels{/name}","releases_url":"https://api.github.com/repos/automaticdreams/assets-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/automaticdreams/assets-frontend/deployments","created_at":"2016-11-22T14:45:29Z","updated_at":"2016-11-22T14:45:32Z","pushed_at":"2016-11-30T13:06:32Z","git_url":"git://github.com/automaticdreams/assets-frontend.git","ssh_url":"git@github.com:automaticdreams/assets-frontend.git","clone_url":"https://github.com/automaticdreams/assets-frontend.git","svn_url":"https://github.com/automaticdreams/assets-frontend","homepage":"","size":21230,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"hmrc:master","ref":"master","sha":"4e6b261a2aa78ff0f2ea021c3f9c9a954d84043f","user":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"repo":{"id":26324661,"name":"assets-frontend","full_name":"hmrc/assets-frontend","owner":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmrc/assets-frontend","description":"Shared static assets for frontends on the Multichannel Digital Tax Platform - http://hmrc.github.io/assets-frontend","fork":false,"url":"https://api.github.com/repos/hmrc/assets-frontend","forks_url":"https://api.github.com/repos/hmrc/assets-frontend/forks","keys_url":"https://api.github.com/repos/hmrc/assets-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmrc/assets-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmrc/assets-frontend/teams","hooks_url":"https://api.github.com/repos/hmrc/assets-frontend/hooks","issue_events_url":"https://api.github.com/repos/hmrc/assets-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/hmrc/assets-frontend/events","assignees_url":"https://api.github.com/repos/hmrc/assets-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/hmrc/assets-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/hmrc/assets-frontend/tags","blobs_url":"https://api.github.com/repos/hmrc/assets-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmrc/assets-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmrc/assets-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmrc/assets-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmrc/assets-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/hmrc/assets-frontend/languages","stargazers_url":"https://api.github.com/repos/hmrc/assets-frontend/stargazers","contributors_url":"https://api.github.com/repos/hmrc/assets-frontend/contributors","subscribers_url":"https://api.github.com/repos/hmrc/assets-frontend/subscribers","subscription_url":"https://api.github.com/repos/hmrc/assets-frontend/subscription","commits_url":"https://api.github.com/repos/hmrc/assets-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmrc/assets-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmrc/assets-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmrc/assets-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmrc/assets-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/hmrc/assets-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmrc/assets-frontend/merges","archive_url":"https://api.github.com/repos/hmrc/assets-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmrc/assets-frontend/downloads","issues_url":"https://api.github.com/repos/hmrc/assets-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/hmrc/assets-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/hmrc/assets-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/hmrc/assets-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmrc/assets-frontend/labels{/name}","releases_url":"https://api.github.com/repos/hmrc/assets-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/hmrc/assets-frontend/deployments","created_at":"2014-11-07T15:11:39Z","updated_at":"2016-11-08T10:04:42Z","pushed_at":"2016-12-01T09:30:46Z","git_url":"git://github.com/hmrc/assets-frontend.git","ssh_url":"git@github.com:hmrc/assets-frontend.git","clone_url":"https://github.com/hmrc/assets-frontend.git","svn_url":"https://github.com/hmrc/assets-frontend","homepage":"","size":24338,"stargazers_count":8,"watchers_count":8,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":59,"mirror_url":null,"open_issues_count":113,"forks":59,"open_issues":113,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmrc/assets-frontend/pulls/725"},"html":{"href":"https://github.com/hmrc/assets-frontend/pull/725"},"issue":{"href":"https://api.github.com/repos/hmrc/assets-frontend/issues/725"},"comments":{"href":"https://api.github.com/repos/hmrc/assets-frontend/issues/725/comments"},"review_comments":{"href":"https://api.github.com/repos/hmrc/assets-frontend/pulls/725/comments"},"review_comment":{"href":"https://api.github.com/repos/hmrc/assets-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmrc/assets-frontend/pulls/725/commits"},"statuses":{"href":"https://api.github.com/repos/hmrc/assets-frontend/statuses/4beff9f18ba41899b13291dcee10926738eca3e5"}}}}
{"actor":{"display_login":"feedmypixel"}}