mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Split menubar elements in multiple parts
This commit is contained in:
		@@ -1,10 +1,10 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Menu bar object
 | 
			
		||||
 * Menu bar object - common methods
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.components.menuBar = {
 | 
			
		||||
ComunicWeb.components.menuBar.common = {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Display menu bar
 | 
			
		||||
	 * 
 | 
			
		||||
@@ -71,6 +71,15 @@ ComunicWeb.components.menuBar = {
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
		//Now we need to know if user is logged in or not
 | 
			
		||||
		
 | 
			
		||||
		var userLoggedIn = ComunicWeb.user.userLogin.getUserLoginState();
 | 
			
		||||
 | 
			
		||||
		//Call specific menu
 | 
			
		||||
		if(userLoggedIn){
 | 
			
		||||
			//Not implemented yet
 | 
			
		||||
		}
 | 
			
		||||
		else{
 | 
			
		||||
			//Call not-logged-in menu
 | 
			
		||||
			ComunicWeb.components.menuBar.notAuthenticated.addElements(containerElem);
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										16
									
								
								assets/js/components/menuBar/notAuthenticated.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								assets/js/components/menuBar/notAuthenticated.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Not authenticated menu bar components
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.components.menuBar.notAuthenticated = {
 | 
			
		||||
    /**
 | 
			
		||||
     * Add not-authenticated user specific elements
 | 
			
		||||
     * 
 | 
			
		||||
     * @param {HTMLElement} addElements The container element of the Menubar
 | 
			
		||||
     */
 | 
			
		||||
    addElements: function(addElements){
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user