Skip to content

Instantly share code, notes, and snippets.

@iotashan
Forked from joshualambert/gist:4128161
Created November 21, 2012 22:06
Show Gist options
  • Save iotashan/4128173 to your computer and use it in GitHub Desktop.
Save iotashan/4128173 to your computer and use it in GitHub Desktop.
Switch loop
followMeSwtichCheckbox.eventOverride = false;
followMeSwtichCheckbox.addEventListener('change', function(e) {
if (!followMeSwtichCheckbox.eventOverride) {
if (checkSOSactive() === false) {
alert('SOS inactive.');
} else {
followMeSwtichCheckbox.eventOverride = true;
followMeSwtichCheckbox.value = !followMeSwtichCheckbox.value;
}
} else {
followMeSwtichCheckbox.eventOverride = false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment