fixes js button switch
Merge pull request #2967 from digi604/fix-2904

fixes js button switch