Offcanvas window.location moved to location.href

Stackoverflow says this is better
Adding check for href, causes error if undefined