Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #80 from multinet-app/sidebar-delete-workspace
Browse files Browse the repository at this point in the history
Sidebar delete workspace
  • Loading branch information
jtomeck committed Jul 15, 2019
2 parents 828e03f + 4fe4fb4 commit 6110a3f
Showing 1 changed file with 63 additions and 15 deletions.
78 changes: 63 additions & 15 deletions client/src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,60 @@
/>

<v-list subheader>
<v-subheader>Your Workspaces</v-subheader>
<v-subheader class="pr-2">
Your Workspaces
<v-spacer />

<v-tooltip right>
<template v-slot:activator="{ on }">
<v-scroll-x-transition>
<v-btn
flat
icon
v-if="somethingChecked"
v-on="on"
>
<v-icon color="red accent-3">delete_sweep</v-icon>
</v-btn>
</v-scroll-x-transition>
</template>
<span>Delete selected</span>
</v-tooltip>
</v-subheader>

<v-divider></v-divider>

<v-list-tile
active-class="grey lighten-4"
avatar
ripple
:key="space"
:to="`/workspaces/${space}/`"
<v-hover
v-for="space in workspaces"
:key="space"
>
<v-list-tile-avatar>
<v-icon color="primary">library_books</v-icon>
</v-list-tile-avatar>
<v-list-tile
active-class="grey lighten-4"
avatar
ripple
slot-scope="{ hover }"
:to="`/workspaces/${space}/`"
>
<v-list-tile-avatar @click.prevent>
<v-scale-transition leave-absolute>
<v-icon
color="primary"
v-if="!hover && !checkbox[space]"
>library_books</v-icon>

<v-checkbox
class="ws-checkbox"
v-else
v-model="checkbox[space]"
></v-checkbox>
</v-scale-transition>
</v-list-tile-avatar>

<v-list-tile-content>
<v-list-tile-title>{{space}}</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile-content>
<v-list-tile-title>{{space}}</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</v-hover>
</v-list>
</v-navigation-drawer>
</template>
Expand All @@ -59,12 +93,19 @@ export default {
return {
newWorkspace: '',
workspaces: [],
right: null
right: null,
checkbox: {}
}
},
components: {
WorkspaceDialog
},
computed: {
somethingChecked() {
return Object.values(this.checkbox)
.some(d => !!d);
}
},
methods: {
route (workspace) {
this.$router.push(`/workspaces/${workspace}`);
Expand All @@ -83,3 +124,10 @@ export default {
}
}
</script>

<style scoped>
.ws-checkbox.v-input--selection-controls {
margin-top: 19px;
margin-left: 8px;
}
</style>

0 comments on commit 6110a3f

Please sign in to comment.