Added event listener to toggle TL_VIEW cookie

I started reviewing/working on the routing feature and stumbled over this part. The only difference I can see is the toggle action is executed everywhere and not only for regular pages, but I don't think that would be a problem?
If the user input is valid, `toggle_view` will be a string already ("mobile" or "desktop"). Otherwise the comparison will fail anyways, so the cast is actually not necessary.