{"action":"created","issue":{"url":"https://api.github.com/repos/georgestephanis/two-factor/issues/52","labels_url":"https://api.github.com/repos/georgestephanis/two-factor/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/georgestephanis/two-factor/issues/52/comments","events_url":"https://api.github.com/repos/georgestephanis/two-factor/issues/52/events","html_url":"https://github.com/georgestephanis/two-factor/issues/52","id":105266702,"number":52,"title":"When someone selects a method as `Primary` it should always be `Enabled` too.","user":{"login":"georgestephanis","id":941023,"avatar_url":"https://avatars.githubusercontent.com/u/941023?v=3","gravatar_id":"","url":"https://api.github.com/users/georgestephanis","html_url":"https://github.com/georgestephanis","followers_url":"https://api.github.com/users/georgestephanis/followers","following_url":"https://api.github.com/users/georgestephanis/following{/other_user}","gists_url":"https://api.github.com/users/georgestephanis/gists{/gist_id}","starred_url":"https://api.github.com/users/georgestephanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgestephanis/subscriptions","organizations_url":"https://api.github.com/users/georgestephanis/orgs","repos_url":"https://api.github.com/users/georgestephanis/repos","events_url":"https://api.github.com/users/georgestephanis/events{/privacy}","received_events_url":"https://api.github.com/users/georgestephanis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/georgestephanis/two-factor/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/georgestephanis/two-factor/labels/JS%20Focus","name":"JS Focus","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-07T20:57:11Z","updated_at":"2015-09-08T10:57:21Z","closed_at":null,"body":"When it is set as primary, toggle the linked Enabled checkbox to on."},"comment":{"url":"https://api.github.com/repos/georgestephanis/two-factor/issues/comments/138517670","html_url":"https://github.com/georgestephanis/two-factor/issues/52#issuecomment-138517670","issue_url":"https://api.github.com/repos/georgestephanis/two-factor/issues/52","id":138517670,"user":{"login":"shield-9","id":3660715,"avatar_url":"https://avatars.githubusercontent.com/u/3660715?v=3","gravatar_id":"","url":"https://api.github.com/users/shield-9","html_url":"https://github.com/shield-9","followers_url":"https://api.github.com/users/shield-9/followers","following_url":"https://api.github.com/users/shield-9/following{/other_user}","gists_url":"https://api.github.com/users/shield-9/gists{/gist_id}","starred_url":"https://api.github.com/users/shield-9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shield-9/subscriptions","organizations_url":"https://api.github.com/users/shield-9/orgs","repos_url":"https://api.github.com/users/shield-9/repos","events_url":"https://api.github.com/users/shield-9/events{/privacy}","received_events_url":"https://api.github.com/users/shield-9/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T10:57:21Z","updated_at":"2015-09-08T10:57:21Z","body":"When every time changed (I feel this is too noisy):\r\n```javascript\r\n$(':radio[name=\"_two_factor_provider\"]').change( function() {\r\n\t$(':checkbox[name=\"_two_factor_enabled_providers\\\\[\\\\]\"]')\r\n\t\t.filter('[value=\"' + this.value + '\"]')\r\n\t\t.prop('checked', true);\r\n});\r\n```\r\n\r\nOr when submit:\r\n```javascript\r\n$('#your-profile').submit(function(){\r\n\t$(':checkbox[name=\"_two_factor_enabled_providers\\\\[\\\\]\"]')\r\n\t\t.filter('[value=\"' + $(':radio[name=\"_two_factor_provider\"]:checked').val() + '\"]')\r\n\t\t.prop('checked', true);\r\n});\r\n```\r\n\r\nI think the latter is better."}}