Last active
September 16, 2019 18:27
-
-
Save fmcat/e0d9643829df93df7d5e1689f8d0f422 to your computer and use it in GitHub Desktop.
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
function switchLayouts(){ var featureToggleString = 'ft_override_enable_pdp_below_the_fold_layout'; | |
var url = new URL(window.location); | |
var params = params = new URLSearchParams(url.search); | |
var toggleValue = params.get(featureToggleString); | |
const isToggleOff = !toggleValue || toggleValue === 'OFF'; | |
params.set(featureToggleString, isToggleOff ? 'ON' : 'OFF'); | |
window.location.search = '?' + params.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment