27 lines
769 B
JavaScript
Executable File
27 lines
769 B
JavaScript
Executable File
DOM = {
|
|
WRAPPER: $('WRAPPER'),
|
|
HEADER: $('HEADER'),
|
|
MENUSIDE: $('MENU-SIDE'),
|
|
CONTAINER: $('CONTAINER')
|
|
};
|
|
|
|
|
|
/* [0] Instanciation
|
|
===========================================*/
|
|
var pageManager = new pageManagerClass();
|
|
pageManager.setPage(null, 'view', DOM.CONTAINER, ['dashboard', 'machines', 'users', 'sync', 'settings'] );
|
|
|
|
|
|
/* [1] Gestion de la navigation
|
|
===========================================*/
|
|
DOM.MENUSIDE.addEventListener('click', function(e){
|
|
var target = e.target;
|
|
|
|
// On remonte dans les parents au bon niveau
|
|
while( target != document.body && !getData(target, 'link') )
|
|
target = target.parentNode;
|
|
|
|
// Si on a trouve l'element, on l'utilise pour la page
|
|
if( getData(target, 'link') )
|
|
pageManager.setPage(target.dataset.link);
|
|
}, false); |