From b061f0e9821120fa042dffa99bc56c497a3bcc0a Mon Sep 17 00:00:00 2001 From: Adam Procter <adamprocter@researchnot.es> Date: Tue, 6 Oct 2020 23:57:21 +0100 Subject: [PATCH] fixed shortcuts should always work delighful / QoL update to focus microcosm field after inputing name (still need form validation mind) --- app/src/components/ListLayer.vue | 2 +- app/src/components/OnBoard.vue | 13 +++++++++++-- app/src/views/Home.vue | 1 + app/src/views/List.vue | 11 +---------- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/src/components/ListLayer.vue b/app/src/components/ListLayer.vue index 25b5c4f..63ae6ce 100644 --- a/app/src/components/ListLayer.vue +++ b/app/src/components/ListLayer.vue @@ -14,8 +14,8 @@ v-model="value.node_text" @input="editNode" :id="value.node_id" - ref="nodetext" placeholder="Idea goes here!" + ref="newnode" ></textarea> </div> </div> diff --git a/app/src/components/OnBoard.vue b/app/src/components/OnBoard.vue index c6184ac..909f481 100644 --- a/app/src/components/OnBoard.vue +++ b/app/src/components/OnBoard.vue @@ -16,6 +16,7 @@ <p id="nodeid" :inner-html.prop="nodetext | marked"></p> <div v-if="name == false"> <input + id="clientid" type="text" v-model.trim="clientid" placeholder="name" @@ -55,6 +56,8 @@ <p id="nodeid" :inner-html.prop="nodetext2 | marked"></p> <div v-if="microcosm == false"> <input + id="microcosm" + ref="microcosm" type="text" v-model.trim="localmicrocosm" placeholder="microcosm name" @@ -85,11 +88,11 @@ <div v-if="name == false"> <input type="text" + id="clientid" v-model.trim="clientid" placeholder="name" autocorrect="off" autocapitalize="none" - ref="objectname" v-on:keyup.enter="setClient()" autofocus @focus="editTrue(true)" @@ -111,10 +114,12 @@ <p id="nodeid" :inner-html.prop="nodetext2 | marked"></p> <div v-if="microcosm == false"> <input + id="microcosm" type="text" v-model.trim="localmicrocosm" placeholder="microcosm name" autocorrect="off" + ref="microcosm" autocapitalize="none" @focus="editTrue(true)" @blur="editTrue(false)" @@ -153,7 +158,6 @@ export default { '## Join/Start a microcosm ! 🚀 \n Now you can create your own microcosm to store your ideas and ask people to join you, either just tell them the name of the microcosm or share the alpha.nodenogg.in URL and add the ending; </br><em><b>/microcosm/nameofyourmicrocosm</b></em>', name: false, microcosm: false, - // partc: false, } }, @@ -180,6 +184,7 @@ export default { this.$store.dispatch('setClient', this.clientid), localStorage.setItem('myNNClient', this.clientid) this.name = true + this.focusInput() }, editTrue(e) { @@ -189,6 +194,10 @@ export default { letsGo() { this.$emit('clientAdded') }, + + focusInput() { + this.$refs.microcosm.focus() + }, }, } </script> diff --git a/app/src/views/Home.vue b/app/src/views/Home.vue index f1e58a8..684550c 100644 --- a/app/src/views/Home.vue +++ b/app/src/views/Home.vue @@ -134,6 +134,7 @@ export default { uploadready: false, copyready: false, drawready: false, + shortcutstate: false, } }, computed: { diff --git a/app/src/views/List.vue b/app/src/views/List.vue index 0b40d92..7db164e 100644 --- a/app/src/views/List.vue +++ b/app/src/views/List.vue @@ -72,16 +72,7 @@ export default { } }, - mounted() { - // if (localStorage.myNNClient && localStorage.mylastMicrocosm) { - // this.clientid = localStorage.myNNClient - // this.localmicrocosm = localStorage.mylastMicrocosm - // this.createMicrocosm() - // this.setClient() - // this.letsGo() - // this.clientset = 'true' - // } - }, + mounted() {}, methods: { clientAdded() { -- GitLab