From 22ec2dca70ee4c34b19147d52e652aa9f8015228 Mon Sep 17 00:00:00 2001 From: Pierre Date: Thu, 25 May 2017 15:25:39 +0200 Subject: [PATCH] Avatar can be dynamicaly changed --- assets/js/components/menuBar/authenticated.js | 10 +++++++++- assets/js/pages/home/landingPage.js | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/js/components/menuBar/authenticated.js b/assets/js/components/menuBar/authenticated.js index 781467a8..95fc502e 100644 --- a/assets/js/components/menuBar/authenticated.js +++ b/assets/js/components/menuBar/authenticated.js @@ -95,6 +95,14 @@ ComunicWeb.components.menuBar.authenticated = { userNameElem.innerHTML = "Loading..."; //Make a request to get informations about the user - + ComunicWeb.user.getUserInfos.getUserInfos("current", (function(userInfos){ + + //Change user name + userNameElem.innerHTML = userInfos.firstName + " "+ userInfos.lastName; + + //Change avatar url + userimage.src = userInfos.accountImage; + + })); }, }; \ No newline at end of file diff --git a/assets/js/pages/home/landingPage.js b/assets/js/pages/home/landingPage.js index cadd0a02..f09a5c5a 100644 --- a/assets/js/pages/home/landingPage.js +++ b/assets/js/pages/home/landingPage.js @@ -13,6 +13,9 @@ ComunicWeb.pages.home.landingPage = { //Log action ComunicWeb.debug.logMessage("Open home landing page."); + //Change page title + document.title = "Comunic, a transparent social network"; + //Prepare additional data var additionalData = {};