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.
This commit is contained in:
parent
8833a213a7
commit
b2f241dbba
@ -79,7 +79,7 @@
|
|||||||
totals(newVal, oldVal){
|
totals(newVal, oldVal){
|
||||||
if(oldVal && newVal && newVal[this.numberId] != oldVal[this.numberId]){
|
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.oldNumber = oldVal[this.numberId]
|
||||||
this.newNumber = newVal[this.numberId]
|
this.newNumber = newVal[this.numberId]
|
||||||
@ -90,7 +90,6 @@
|
|||||||
this.animateUp = true
|
this.animateUp = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setTimeout( () => {
|
setTimeout( () => {
|
||||||
this.animateUp = false
|
this.animateUp = false
|
||||||
this.animateDown = false
|
this.animateDown = false
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
<i class="green archive icon"></i>Archived
|
<i class="green archive icon"></i>Archived
|
||||||
<!-- <span>{{ $store.getters.totals['archivedNotes'] }}</span> -->
|
<!-- <span>{{ $store.getters.totals['archivedNotes'] }}</span> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="eight wide column" v-if="showClear">
|
<div class="eight wide column" v-if="showClear">
|
||||||
|
@ -7,11 +7,31 @@
|
|||||||
<i class="paper plane outline icon"></i>
|
<i class="paper plane outline icon"></i>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Quick
|
Quick
|
||||||
<div class="sub header">Add new information with great speed</div>
|
<div class="sub header">Rapidly save text</div>
|
||||||
</div>
|
</div>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="sixteen wide middle aligned column">
|
||||||
|
|
||||||
|
<div class="ui compact basic button"
|
||||||
|
v-on:click="enterToSubmit = !enterToSubmit">
|
||||||
|
<i v-if="enterToSubmit" class="green toggle on icon"></i>
|
||||||
|
<i v-else class="toggle off icon"></i>
|
||||||
|
|
||||||
|
<span v-if="enterToSubmit">Save after Enter press</span>
|
||||||
|
<span v-else>CTRL + Enter to Save</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ui compact basic button"
|
||||||
|
v-on:click="pasteToSubmit = !pasteToSubmit">
|
||||||
|
<i v-if="pasteToSubmit" class="green check circle outline icon"></i>
|
||||||
|
<i v-else class="circle outline icon"></i>
|
||||||
|
Save after Pasting
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="ui sixteen wide column">
|
<div class="ui sixteen wide column">
|
||||||
<div class="ui form">
|
<div class="ui form">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@ -21,14 +41,15 @@
|
|||||||
ref="fastInput"
|
ref="fastInput"
|
||||||
v-model="newText"
|
v-model="newText"
|
||||||
v-on:keydown="checkKeyup"
|
v-on:keydown="checkKeyup"
|
||||||
|
v-on:paste="onPaste"
|
||||||
placeholder="Push to the top of the quick note."
|
placeholder="Push to the top of the quick note."
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div v-on:click="appendQuickNote" class="ui green button">Save (CRTL + Enter)</div>
|
<div v-on:click="appendQuickNote" class="ui green button">Save</div>
|
||||||
<div v-if="quickNoteId" class="ui right floated basic button" v-on:click="$router.push('/attachments/note/'+quickNoteId)">
|
<div v-if="quickNoteId" class="ui right floated basic button" v-on:click="$router.push('/attachments/note/'+quickNoteId)">
|
||||||
<i class="folder open outline icon"></i>
|
<i class="folder open outline icon"></i>
|
||||||
Quick Files + Links
|
Files
|
||||||
</div>
|
</div>
|
||||||
<div v-if="quickNoteId" v-on:click="openNoteEdit" class="ui right floated basic button">
|
<div v-if="quickNoteId" v-on:click="openNoteEdit" class="ui right floated basic button">
|
||||||
<i class="file outline icon"></i>
|
<i class="file outline icon"></i>
|
||||||
@ -57,7 +78,9 @@
|
|||||||
return {
|
return {
|
||||||
newText: '',
|
newText: '',
|
||||||
savedQuickNoteText: '',
|
savedQuickNoteText: '',
|
||||||
quickNoteId: null
|
quickNoteId: null,
|
||||||
|
pasteToSubmit: true,
|
||||||
|
enterToSubmit: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeCreate: function(){
|
beforeCreate: function(){
|
||||||
@ -95,9 +118,17 @@
|
|||||||
element.style.height = 'auto';
|
element.style.height = 'auto';
|
||||||
element.style.height = (element.scrollHeight + padding) +'px';
|
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 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()
|
this.appendQuickNote()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
appendQuickNote(){
|
appendQuickNote(){
|
||||||
@ -122,6 +153,15 @@
|
|||||||
this.quickNoteId = results.data.id
|
this.quickNoteId = results.data.id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onPaste(event){
|
||||||
|
|
||||||
|
if(this.pasteToSubmit == true){
|
||||||
|
setTimeout( () => {
|
||||||
|
this.appendQuickNote()
|
||||||
|
}, 10)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue
Block a user