From 8ed52e7b3c5a8ffde0b1316c515521004f85df32 Mon Sep 17 00:00:00 2001 From: Abhijeet Anand Date: Thu, 21 Jan 2021 19:59:57 +0530 Subject: [PATCH] Update index.html adding group1 feature --- index.html | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index ec41486..ca33382 100644 --- a/index.html +++ b/index.html @@ -1576,6 +1576,34 @@ } }) + let mygroup = []; + + function selectContact(contact){ + + if(mygroup.includes(clickedContact.floID)){ + alert("user is already selected"); + } + else{ + mygroup.push(clickedContact.floID); + } + getRef("selected_contacts_container").innerHTML=mygroup; + } + + + function removeContact(floID){ + + mygroup=mygroup.filter( item => item !== floID ) + console.log(mygroup); + + } + + function clearAllMember(){ + mygroup=[]; + console.log("Empty "+ mygroup); + + } + + let clickedContact = {} getRef('contacts').addEventListener('click', e => { //detect click on chat cards @@ -1588,7 +1616,9 @@ showPopup('contact_details_popup') } else if(isCreatingGroup){ - // code for adding group members + selectContact(contact); + console.log(mygroup) + } else{ createRipple(e, contact)