Skip to content

Commit

Permalink
Active group in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
arj03 committed Nov 18, 2021
1 parent c0fccf5 commit 0487e3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions dist/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ body {
overflow:auto;
}

.activegroup {
font-weight: bold;
color: #90EE90
}

#main {
margin-left: 13rem;
padding-left: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<b>Groups</b><span style="padding-left: 5px;" class="link" v-on:click="newGroup()" title="Create a new group">🌱</span>
<ul v-for="group in groups" class="dashed">
<li class="link">
<li class="link" v-bind:class="{ activegroup: group.id == activeGroupId }">
<span v-on:click="openGroup(group)" title="Open group">{{ group.title }}</span>
</li>
</ul>
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ const menu = new Vue({
groups: [],
peers: [],

activeGroupId: '',

// group dialog
groupKey: '',
showGroupEdit: false,
Expand All @@ -117,6 +119,7 @@ const menu = new Vue({
methods: {
dumpDB,
openGroup: function(group) {
this.activeGroupId = group.id
new Vue(chatApp(pull, ssbSingleton, group, getChatFeed)).$mount("#app")
},
editGroupConfig: function(group) {
Expand Down Expand Up @@ -179,7 +182,8 @@ const menu = new Vue({
if (err) return console.error(err)

this.showGroupEdit = false

this.activeGroupId = groupId

new Vue(
chatApp(pull, ssbSingleton,
{ key: groupKey, id: groupId }, getChatFeed)
Expand Down

0 comments on commit 0487e3e

Please sign in to comment.