Don't upgrade logout link if form doesn't exist (#39)

Fixes #38
This commit is contained in:
Jason Korth 2018-03-19 17:15:46 -05:00 committed by Jono Menz
parent bfa6a310b6
commit 39d1aed274

View File

@ -32,12 +32,14 @@ function initialiseBetterNavigator() {
if (getCookie('BetterNavigator') === 'open') {
BetterNavigator.className = 'open';
}
// Upgrade logout link to directly log users out instead of redirecting to logout form
BetterNavigatorLogoutLink.onclick = function (e) {
e.preventDefault();
BetterNavigatorLogoutForm.submit();
};
if (BetterNavigatorLogoutForm) {
// Upgrade logout link to directly log users out instead of redirecting to logout form
BetterNavigatorLogoutLink.onclick = function (e) {
e.preventDefault();
BetterNavigatorLogoutForm.submit();
};
}
}
if (document.addEventListener && document.readyState === 'loading') {