Skip to content

Commit

Permalink
Merge pull request #503 from nextcloud/fix/475-pasting-single-lines
Browse files Browse the repository at this point in the history
Allow pasting of normal content
  • Loading branch information
christianlupus authored Jan 13, 2021
2 parents 12fced3 + 51eea94 commit 58a0b97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
[#501](https://github.com/nextcloud/cookbook/pull/500) @christianlupus
- Allow to save recipes with custom image URLs
[#505](https://github.com/nextcloud/cookbook/pull/505) @christianlupus
- Allow pasting of instructions without newline again
[#503](https://github.com/nextcloud/cookbook/pull/503) @christianlupus


## 0.7.8 - 2021-01-08
Expand Down
13 changes: 12 additions & 1 deletion src/components/EditInputGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default {
return {
// helper variables
buffer: this.value.slice(),
contentPasted: false
contentPasted: false,
singleLinePasted: false
}
},
watch: {
Expand Down Expand Up @@ -93,6 +94,11 @@ export default {
this.$nextTick(function() {
if (this.contentPasted) {
this.contentPasted = false
if(this.singleLinePasted) {
this.$emit('input', this.buffer)
}
return
}
this.$emit('input', this.buffer)
Expand All @@ -113,9 +119,14 @@ export default {
var pastedData = clipboardData.getData('Text')
let input_lines_array = pastedData.split(/\r\n|\r|\n/g)
if ( input_lines_array.length == 1) {
this.singleLinePasted = true
return
} else {
this.singleLinePasted = false
}
e.preventDefault()
let $li = $(e.currentTarget).parents('li')
Expand Down

0 comments on commit 58a0b97

Please sign in to comment.