Skip to content
Snippets Groups Projects
Commit f53170e5 authored by Joey Ballentine's avatar Joey Ballentine
Browse files

yikes

parent f1ae19c4
Branches
Tags
No related merge requests found
...@@ -27,21 +27,23 @@ $(document).ready(function() { ...@@ -27,21 +27,23 @@ $(document).ready(function() {
var services = ['netflix', 'hulu', 'hbo', 'showtime', 'prime', 'crunchyroll']; var services = ['netflix', 'hulu', 'hbo', 'showtime', 'prime', 'crunchyroll'];
for (service of services) { function checkTheToggles(service) {
console.log(service); // $('#' + service + '-switch').not(':checked').prop("checked", true);
$(document).on('click', '#' + service + '-switch', function() {
$('#' + service + '-switch').not(':checked').prop("checked", true);
updateList();
// if ($('#' + service + '-switch').val() === 'on') {
// $('#' + service + '-switch').val('off');
// updateList(); // updateList();
// } else { if ($('#' + service + '-switch').val() === 'on') {
// $('#' + service + '-switch').val('on'); $('#' + service + '-switch').val('off');
// updateList(); updateList();
// } console.log('yikes');
}); } else {
$('#' + service + '-switch').val('on');
updateList();
console.log('jeepers');
}
} }
for (service of services) {
$('#' + service + '-switch').addEventListener("click", checkTheToggles(service));
}
let serviceToLoginID = new Map(); let serviceToLoginID = new Map();
serviceToLoginID.set("#netflixLogin", ["Netflix", "netflix"]); serviceToLoginID.set("#netflixLogin", ["Netflix", "netflix"]);
...@@ -269,9 +271,9 @@ $(document).ready(function() { ...@@ -269,9 +271,9 @@ $(document).ready(function() {
function updateList() { function updateList() {
let activeServices = []; let activeServices = [];
for (service of services) { for (service of services) {
if ($('#' + service + '-switch').val() === 'on') {
console.log($('#' + service + '-switch').val()); console.log($('#' + service + '-switch').val());
console.log('#' + service + '-switch'); console.log('#' + service + '-switch');
if ($('#' + service + '-switch').val() === 'on') {
activeServices.push(service); activeServices.push(service);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment