$(function(){
const menuHome = $(".menu > .home");
const menuDashboard = $(".menu > .dashboard");
const menuHistiry = $(".menu > .record");
const menuStatistics = $(".menu > .statistics");
const menuSystemMenagement = $(".menu > .system-manager");
const logOut = $(".menu > .logout");

function moveLocation(el, location) {
    if (el[0]) {
        el.on('click', function () {
            console.log('click');
            console.log(location);
            window.location.href = location;
        })
    }
}
    moveLocation(menuHome, '/home.do');
    moveLocation(menuDashboard, '/dashBoard.do');
    moveLocation(menuHistiry, '/history.do');
    moveLocation(menuStatistics, '/statistics.do');
    moveLocation(menuSystemMenagement, '/systemManagement.do');
    moveLocation(logOut, '/logout.do');

//
// menuDashboard[0].onclick=(()=>{
//     location.href=('/dashBoard.do');
// })
// menuHistiry[0].onclick=(()=>{
//     location.href=('/history.do');
// })
// menuStatistics[0].onclick=(()=>{
//     location.href=('/statistics.do');
// })
// menuSystemMenagement[0].onclick=(()=>{
//     location.href=('/systemManagement.do');
// })
//
// logOut.on("click",()=>{
// 	location.href=('/logout.do');
// })


})
