diff options
author | dartcafe <github@dartcafe.de> | 2020-04-29 15:53:53 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-04-29 15:53:53 +0300 |
commit | 9579a6dfab783ed267a4f04552427e132e41b98b (patch) | |
tree | a5baaa017b88df1c5c9e9890e76c2bb688353fac /src/js/components/PollList | |
parent | ea45bb2deff5e3222415ab425df0e078b515eb64 (diff) |
Move sidebar to top level and use in pollList
Diffstat (limited to 'src/js/components/PollList')
-rw-r--r-- | src/js/components/PollList/PollListItem.vue | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/js/components/PollList/PollListItem.vue b/src/js/components/PollList/PollListItem.vue index 1bfd47e5..104da9a1 100644 --- a/src/js/components/PollList/PollListItem.vue +++ b/src/js/components/PollList/PollListItem.vue @@ -48,7 +48,8 @@ </div> </div> - <div v-else class="pollListItem poll" :class="{ expired: isExpired }"> + <div v-else class="pollListItem poll" :class="{ expired: isExpired, active: (poll.id === $store.state.poll.id) }" + @click="loadPoll()"> <div v-tooltip.auto="pollType" class="icon type-icon" :class="[poll.type]"> {{ pollType }} </div> @@ -167,6 +168,19 @@ export default { }, methods: { + loadPoll() { + this.$store.dispatch({ type: 'loadPollMain', pollId: this.poll.id }) + .then((response) => { + this.$store.dispatch({ type: 'loadPoll', pollId: this.poll.id }) + this.$root.$emit('openSideBar') + }) + .catch((error) => { + console.error(error) + OC.Notification.showTemporary(t('polls', 'Error loading poll'), { type: 'error' }) + }) + + }, + toggleMenu() { this.openedMenu = !this.openedMenu }, @@ -217,7 +231,6 @@ export default { flex: 1; border-bottom: 1px solid var(--color-border-dark); padding: 4px 8px; - &> div { padding-right: 8px; } @@ -242,6 +255,12 @@ export default { } &.poll { + &.active { + background-color: var(--color-primary-light); + } + &:hover { + background-color: var(--color-background-hover); + } .poll-title { flex-direction: column; & > * { |