Created
November 21, 2012 22:03
-
-
Save joshualambert/4128161 to your computer and use it in GitHub Desktop.
Switch loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
followMeSwtichCheckbox.eventOverride = false; | |
followMeSwtichCheckbox.addEventListener('change', function(e) { | |
if (followMeSwtichCheckbox.eventOverride == false) { | |
if (checkSOSactive() == false) { | |
alert('SOS inactive.'); | |
} else { | |
followMeSwtichCheckbox.eventOverride = true; | |
if (followMeSwtichCheckbox.value == true) { | |
followMeSwtichCheckbox.value = false; | |
} else { | |
followMeSwtichCheckbox.value = true; | |
} | |
alert('SOS active.'); | |
followMeSwtichCheckbox.eventOverride = false; | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment