From e56042958b0999350e5dc820e088696e555c3934 Mon Sep 17 00:00:00 2001 From: Max G Date: Fri, 14 Feb 2020 05:31:38 +0000 Subject: [PATCH] Added paste event to quick notes allowing for quick note to submit the second data is pasted in Added option on quick note to submit with enter or CTRL + ENTER Removed a console log statement. --- .../components/AnimatedCounterComponent.vue | 3 +- client/src/pages/NotesPage.vue | 1 + client/src/pages/QuickPage.vue | 50 +++++++++++++++++-- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/client/src/components/AnimatedCounterComponent.vue b/client/src/components/AnimatedCounterComponent.vue index 276bd99..48fffc9 100644 --- a/client/src/components/AnimatedCounterComponent.vue +++ b/client/src/components/AnimatedCounterComponent.vue @@ -79,7 +79,7 @@ totals(newVal, oldVal){ if(oldVal && newVal && newVal[this.numberId] != oldVal[this.numberId]){ - console.log('New number ', newVal[this.numberId]) + // console.log('New number ', newVal[this.numberId]) this.oldNumber = oldVal[this.numberId] this.newNumber = newVal[this.numberId] @@ -90,7 +90,6 @@ this.animateUp = true } - setTimeout( () => { this.animateUp = false this.animateDown = false diff --git a/client/src/pages/NotesPage.vue b/client/src/pages/NotesPage.vue index ae582e4..61b22ff 100644 --- a/client/src/pages/NotesPage.vue +++ b/client/src/pages/NotesPage.vue @@ -28,6 +28,7 @@ Archived +
diff --git a/client/src/pages/QuickPage.vue b/client/src/pages/QuickPage.vue index 1f6400c..f6fdbb3 100644 --- a/client/src/pages/QuickPage.vue +++ b/client/src/pages/QuickPage.vue @@ -7,11 +7,31 @@
Quick -
Add new information with great speed
+
Rapidly save text
+
+ +
+ + + + Save after Enter press + CTRL + Enter to Save + +
+ +
+ + + Save after Pasting +
+
+
@@ -21,14 +41,15 @@ ref="fastInput" v-model="newText" v-on:keydown="checkKeyup" + v-on:paste="onPaste" placeholder="Push to the top of the quick note." >
-
Save (CRTL + Enter)
+
Save
- Quick Files + Links + Files
@@ -57,7 +78,9 @@ return { newText: '', savedQuickNoteText: '', - quickNoteId: null + quickNoteId: null, + pasteToSubmit: true, + enterToSubmit: true, } }, beforeCreate: function(){ @@ -95,9 +118,17 @@ element.style.height = 'auto'; element.style.height = (element.scrollHeight + padding) +'px'; + //Enter Key submits by default + if(event.keyCode == 13 && this.enterToSubmit == true){ + this.appendQuickNote() + return + } + + //Alternate submit //If command+enter or control+enter is pressed, submit - if((event.metaKey || event.ctrlKey) && [13].includes(event.keyCode)){ + if((event.metaKey || event.ctrlKey) && [13].includes(event.keyCode) && this.enterToSubmit == false){ this.appendQuickNote() + return } }, appendQuickNote(){ @@ -122,6 +153,15 @@ this.quickNoteId = results.data.id }) }, + onPaste(event){ + + if(this.pasteToSubmit == true){ + setTimeout( () => { + this.appendQuickNote() + }, 10) + } + return true + }, } } \ No newline at end of file