diff options
| author | jdlugosz963 <jdlugosz963@gmail.com> | 2021-12-12 23:09:20 +0100 |
|---|---|---|
| committer | jdlugosz963 <jdlugosz963@gmail.com> | 2021-12-12 23:09:20 +0100 |
| commit | 4b6be9f09ff56dfae1c719cb744f2312e11be317 (patch) | |
| tree | 35ea43304a32dc47ed1a7289052d1b97fca944dd /src/views | |
| parent | 10abd20260050174dd508038f0b95c5f8f740933 (diff) | |
| download | lom_frontend-4b6be9f09ff56dfae1c719cb744f2312e11be317.tar.gz lom_frontend-4b6be9f09ff56dfae1c719cb744f2312e11be317.zip | |
add group maker
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/Home.vue | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/src/views/Home.vue b/src/views/Home.vue index 2954857..abf6fc8 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue | |||
| @@ -1,18 +1,33 @@ | |||
| 1 | <template> | 1 | <template> |
| 2 | <div class="home" v-hotkey="keymap"> | 2 | <div class="home" v-hotkey="keymap"> |
| 3 | Hi {{get_username}}! | 3 | Hi {{get_username}}! |
| 4 | <input type="button" value="Logout!" @click="logout"> | 4 | <Searcher |
| 5 | <Searcher v-if="show" @close="hide" /> | 5 | v-if="popups.searcher_show" |
| 6 | @close="hideSearcher" | ||
| 7 | @toogle_group_maker="toogleGroupShow" | ||
| 8 | /> | ||
| 9 | |||
| 10 | <GroupMaker | ||
| 11 | v-if="popups.group_maker_show" | ||
| 12 | @close="hideGroup" | ||
| 13 | |||
| 14 | /> | ||
| 6 | </div> | 15 | </div> |
| 7 | </template> | 16 | </template> |
| 8 | 17 | ||
| 9 | <script> | 18 | <script> |
| 10 | import Searcher from '@/components/Searcher.vue' | 19 | import Searcher from '@/components/Searcher.vue' |
| 20 | import GroupMaker from '@/components/GroupMaker.vue' | ||
| 21 | |||
| 22 | const popups = { | ||
| 23 | searcher_show: false, | ||
| 24 | group_maker_show: false | ||
| 25 | } | ||
| 11 | 26 | ||
| 12 | export default { | 27 | export default { |
| 13 | data() { | 28 | data() { |
| 14 | return { | 29 | return { |
| 15 | show: false, | 30 | popups |
| 16 | } | 31 | } |
| 17 | }, | 32 | }, |
| 18 | 33 | ||
| @@ -22,8 +37,11 @@ export default { | |||
| 22 | this.$router.push('/login') | 37 | this.$router.push('/login') |
| 23 | }, | 38 | }, |
| 24 | 39 | ||
| 25 | toogleShow() { this.show = !this.show }, | 40 | toogleSearcherShow() { this.popups.searcher_show = !this.popups.searcher_show }, |
| 26 | hide() { this.show = false } | 41 | hideSearcher() { this.popups.searcher_show = false }, |
| 42 | |||
| 43 | toogleGroupShow() { this.popups.group_maker_show = !this.popups.group_maker_show }, | ||
| 44 | hideGroup() { this.popups.group_maker_show = false } | ||
| 27 | }, | 45 | }, |
| 28 | 46 | ||
| 29 | computed: { | 47 | computed: { |
| @@ -33,15 +51,16 @@ export default { | |||
| 33 | 51 | ||
| 34 | keymap() { | 52 | keymap() { |
| 35 | return { | 53 | return { |
| 36 | 'ctrl+esc': this.toogleShow, | 54 | 'ctrl+esc': this.toogleSearcherShow, |
| 37 | 'ctrl+shift+p': this.toogleShow, | 55 | 'ctrl+shift+p': this.toogleSearcherShow, |
| 38 | 'esc': this.hide | 56 | 'esc': this.hideGroup |
| 39 | } | 57 | } |
| 40 | } | 58 | } |
| 41 | }, | 59 | }, |
| 42 | 60 | ||
| 43 | components: { | 61 | components: { |
| 44 | Searcher | 62 | Searcher, |
| 63 | GroupMaker | ||
| 45 | }, | 64 | }, |
| 46 | 65 | ||
| 47 | created() { | 66 | created() { |
