From 34be87c09697228299b6fdc335586801f6f817a0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 13 Apr 2020 14:51:22 +0200 Subject: [PATCH] Notify calls in sidebar --- assets/css/components/sidebar.css | 48 ++++++++++++++++++++-------- assets/js/components/sidebar/main.js | 19 +++++++++++ 2 files changed, 54 insertions(+), 13 deletions(-) diff --git a/assets/css/components/sidebar.css b/assets/css/components/sidebar.css index b9bd5466..fc2ad351 100644 --- a/assets/css/components/sidebar.css +++ b/assets/css/components/sidebar.css @@ -86,6 +86,24 @@ body.sidebar-collapse .sidebar-menu { } +body.sidebar-collapse .main-sidebar .memberships-list .subinfo { + display: none; +} + +body.sidebar-collapse .main-sidebar .memberships-list li:hover .subinfo { + display: block; + background: #2c3b41; + position: absolute; + width: 180px; + left: 50px; + padding-top: 5px; + padding-bottom: 5px; + border-bottom-right-radius: 4px; + margin: 7px -3px; + padding-left: 20px; +} + + /** * Conversations entries */ @@ -120,24 +138,28 @@ add left border font-size: 80%; } - -body.sidebar-collapse .main-sidebar .memberships-list .subinfo { +.main-sidebar .conversation_memberhsip.with-call .subinfo { display: none; } -body.sidebar-collapse .main-sidebar .memberships-list li:hover .subinfo { - display: block; - background: #2c3b41; - position: absolute; - width: 180px; - left: 50px; - padding-top: 5px; - padding-bottom: 5px; - border-bottom-right-radius: 4px; - margin: 7px -3px; - padding-left: 20px; + + +.main-sidebar .call_notice { + background-color: #db8b0b82; + margin-bottom: 5px; } +.main-sidebar .call_notice a { + padding-top: 0px; + padding-bottom: 0px; +} + +.main-sidebar .call_notice a:hover { + background-color: #db8b0b82 !important; +} + + + /** * Conversations */ diff --git a/assets/js/components/sidebar/main.js b/assets/js/components/sidebar/main.js index 7e17a48f..176fa720 100644 --- a/assets/js/components/sidebar/main.js +++ b/assets/js/components/sidebar/main.js @@ -576,6 +576,25 @@ const SidebarMain = { innerHTML: timeDiffToStr(conv.last_active) }); + + // Check if there is an ongoing call on the conversation + if(conv.has_call_now) { + + li.classList.add("with-call"); + + let callLi = createElem2({ + appendTo: target, + type: "li", + class: "call_notice" + }); + + let a = createElem2({ + appendTo: callLi, + type: "a", + onclick: () => CallsController.Open(conv), + innerHTML: " Ongoing call" + }); + } }, /**