1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-09-19 08:57:09 +03:00

Make sure that paste does not get executed multiple times

This commit is contained in:
Jan Oberhauser 2019-07-17 18:14:03 +02:00
parent f3d77412a6
commit 4bc21dfef5

View File

@ -3,8 +3,8 @@
* defined on the component which uses this mixin
*/
import Vue from 'vue';
import { debounce } from 'lodash';
// export const copyPaste = {
export const copyPaste = Vue.extend({
data () {
return {
@ -92,7 +92,7 @@ export const copyPaste = Vue.extend({
// Set clipboard event listeners on the document.
['paste'].forEach((event) => {
document.addEventListener(event, (e) => {
document.addEventListener(event, debounce((e) => {
// Check if the event got emitted from a message box or from something
// else which should ignore the copy/paste
// @ts-ignore
@ -118,7 +118,7 @@ export const copyPaste = Vue.extend({
e.preventDefault();
}
}
});
}, 1000, { leading: true }));
});
},
methods: {