Appearance improvments

This commit is contained in:
Pierre HUBERT 2019-05-16 17:38:10 +02:00
parent 8ac1aaafdb
commit a2d444bdb0
3 changed files with 83 additions and 9 deletions

View File

@ -36,3 +36,12 @@ a, .cursor-pointer {
padding: 5px; padding: 5px;
padding-bottom: 0px; padding-bottom: 0px;
} }
/**
* Adapt menu bar to small screens
*/
@media screen and (max-width: 767px) {
#pageTarget {
margin-top: 50px;
}
}

View File

@ -4,8 +4,43 @@
* @author Pierre HUBERT * @author Pierre HUBERT
*/ */
.sidebar-menu.memberships-list img { .main-sidebar > .sidebar {
display: flex;
flex-direction: column;
position: absolute;
height: 100%;
}
body.sidebar-collapse .main-sidebar > .sidebar {
position: unset;
}
body.sidebar-collapse .main-sidebar > .sidebar .hide-on-collapse {
display: none;
}
.main-sidebar .intermediate-label {
color: #c3c3c3;
padding: 10px 25px 0px 15px;
font-size: 12px;
}
.main-sidebar .memberships-list {
flex: 2;
overflow: hidden;
}
body.sidebar-collapse .memberships-list {
overflow: unset;
}
.main-sidebar .memberships-list img {
width: 20px; width: 20px;
margin-right: 10px; margin-right: 10px;
margin-left: -4px; margin-left: -4px;
} }
.main-sidebar .recents-conversations-list {
flex: 1;
}

View File

@ -25,7 +25,7 @@ ComunicWeb.components.sideBar.main = {
var userPanel = createElem2({ var userPanel = createElem2({
appendTo: section, appendTo: section,
type: "div", type: "div",
class: "user-panel" class: "user-panel hidden-xs"
}); });
getUserInfo(userID(), function(info){ getUserInfo(userID(), function(info){
@ -104,15 +104,36 @@ ComunicWeb.components.sideBar.main = {
openPage("search?q=" + searchForm.getElementsByTagName("input")[0].value); openPage("search?q=" + searchForm.getElementsByTagName("input")[0].value);
}); });
// User memberships // User memberships
createElem2({
appendTo: section,
type: "div",
class: "intermediate-label hide-on-collapse",
innerHTML: "FRIENDS & GROUPS"
});
let userMemberships = createElem2({ let userMemberships = createElem2({
appendTo: section, appendTo: section,
type: "ul", type: "div",
class: "sidebar-menu memberships-list" class: "memberships-list"
}); });
this.refreshMemberships(userMemberships); this.refreshMemberships(userMemberships);
// Recent conversations
createElem2({
appendTo: section,
type: "div",
class: "intermediate-label hide-on-collapse",
innerHTML: "CONVERSATIONS"
});
let conversationsList = createElem2({
appendTo: section,
type: "ul",
class: "sidebar-menu recents-conversations-list hide-on-collapse",
innerHTML: "<li><a>TO COME</a></li>"
});
}, },
/** /**
@ -125,8 +146,6 @@ ComunicWeb.components.sideBar.main = {
() => notify("Could not refresh your memberships!", "error"), () => notify("Could not refresh your memberships!", "error"),
(m, u, g) => this.applyMemberships(target, m, u, g) (m, u, g) => this.applyMemberships(target, m, u, g)
); );
}, },
/** /**
@ -142,13 +161,24 @@ ComunicWeb.components.sideBar.main = {
// Empty liste // Empty liste
target.innerHTML = ""; target.innerHTML = "";
let friendsTarget = createElem2({
appendTo: target,
type: "ul",
class: "sidebar-menu"
});
memberships.forEach(e => { memberships.forEach(e => {
if(e.type == "friend") if(e.type == "friend")
this.applyFriend(target, e.friend, users["user-"+e.friend.ID_friend]); this.applyFriend(friendsTarget, e.friend, users["user-"+e.friend.ID_friend]);
if(e.type == "group") if(e.type == "group")
this.applyGroup(target, groups[e.id], e.last_activity); this.applyGroup(friendsTarget, groups[e.id], e.last_activity);
});
$(friendsTarget).slimscroll({
flex: 2,
height: "100%"
}); });
}, },