Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-09-17 11:22:48 +0300
committerdartcafe <github@dartcafe.de>2020-09-17 11:22:48 +0300
commit6ed13d1486970f7242f6df5abe3d3a436b85ac50 (patch)
tree52261ed17ef33cb0558c7bef2a6909feaed06c86 /src/js/views/Vote.vue
parent4765dd1283c94143842faa3c0b9a84dcf3a5d58f (diff)
define default settings for view modesv1.5.2-view2
Diffstat (limited to 'src/js/views/Vote.vue')
-rw-r--r--src/js/views/Vote.vue54
1 files changed, 33 insertions, 21 deletions
diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue
index 3265043e..15973bb1 100644
--- a/src/js/views/Vote.vue
+++ b/src/js/views/Vote.vue
@@ -128,8 +128,8 @@ export default {
delay: 50,
isLoading: true,
ranked: false,
- manualViewDatePoll: false,
- manualViewTextPoll: false,
+ manualViewDatePoll: '',
+ manualViewTextPoll: '',
}
},
@@ -148,37 +148,33 @@ export default {
viewTextPoll() {
if (this.manualViewTextPoll) {
- if (this.settings.user.defaultView.textPoll === 'desktop') {
- return 'mobile'
+ return this.manualViewTextPoll
+ } else {
+ if (window.innerWidth > 480) {
+ return this.settings.user.defaultViewTextPoll
} else {
- return 'desktop'
+ return 'mobile'
}
- } else {
- return this.settings.user.defaultView.textPoll
}
},
viewDatePoll() {
if (this.manualViewDatePoll) {
- if (this.settings.user.defaultView.datePoll === 'desktop') {
- return 'mobile'
- } else {
- return 'desktop'
- }
+ return this.manualViewDatePoll
} else {
- if (window.innerWidth < 481) {
- return 'mobile'
+ if (window.innerWidth > 480) {
+ return this.settings.user.defaultViewDatePoll
} else {
- return this.settings.user.defaultView.datePoll
+ return 'mobile'
}
}
},
viewMode() {
- if (this.poll.type === 'datePoll') {
- return this.viewDatePoll
- } else if (this.poll.type === 'textPoll') {
+ if (this.poll.type === 'textPoll') {
return this.viewTextPoll
+ } else if (this.poll.type === 'datePoll') {
+ return this.viewDatePoll
} else {
return 'desktop'
}
@@ -275,6 +271,14 @@ export default {
emit('toggle-sidebar', { open: true, activeTab: 'options' })
},
+ getNextViewMode() {
+ if (this.settings.viewModes.indexOf(this.viewMode) < 0) {
+ return this.settings.viewModes[1]
+ } else {
+ return this.settings.viewModes[(this.settings.viewModes.indexOf(this.viewMode) + 1) % this.settings.viewModes.length]
+ }
+ },
+
openConfiguration() {
emit('toggle-sidebar', { open: true, activeTab: 'configuration' })
},
@@ -286,9 +290,17 @@ export default {
toggleView() {
emit('transitions-off', { delay: 500 })
if (this.poll.type === 'datePoll') {
- this.manualViewDatePoll = !this.manualViewDatePoll
- } else {
- this.manualViewTextPoll = !this.manualViewTextPoll
+ if (this.manualViewDatePoll) {
+ this.manualViewDatePoll = ''
+ } else {
+ this.manualViewDatePoll = this.getNextViewMode()
+ }
+ } else if (this.poll.type === 'textPoll') {
+ if (this.manualViewTextPoll) {
+ this.manualViewTextPoll = ''
+ } else {
+ this.manualViewTextPoll = this.getNextViewMode()
+ }
}
},