diff --git a/src/components/DeleteButton.vue b/src/components/DeleteButton.vue index 16dc806..7de16f0 100644 --- a/src/components/DeleteButton.vue +++ b/src/components/DeleteButton.vue @@ -1,41 +1,18 @@ - @@ -43,53 +20,27 @@ export default { data() { return { - progress: false, - pressTimer: null, - longPress: false, - confirmHelp: '' + confirm: false } }, props: { - action: {type: Function, required: true}, - text: {type: String, required: true}, - object: {type: Object, required: true} - }, - methods: { - start(event){ - if (event.type === "click" && event.button !== 0) { - return; - } - this.longPress = false; - this.progress = true; - this.pressTimer = setTimeout(() => { - this.longPress = true; - this.deleteConfirmed(); - }, 2000); - return false; - }, - click(){ - if (this.longPress) { - return; - } - if (this.pressTimer !== null) { - clearTimeout(this.pressTimer); - this.pressTimer = null; - } - this.progress = false; - this.confirmHelp = 'Long Press To Confirm'; + confirmText: { + type: String, + default: 'Are you sure you want to delete this?' }, - cancel(){ - if (this.pressTimer !== null) { - clearTimeout(this.pressTimer); - this.pressTimer = null; - this.confirmHelp = ''; - } - this.progress = false; + confirmButton: { + type: String, + default: 'Sure delete it' }, - deleteConfirmed(){ - setTimeout(() => { - this.action(this.object); - }, 1000); + cancelButton: { + type: String, + default: 'Oups no!' + } + }, + methods: { + confirmDelete(){ + this.confirm = false; + this.$emit('remove'); } } } diff --git a/src/views/PasswordGenerator.vue b/src/views/PasswordGenerator.vue index d12541b..96786e8 100644 --- a/src/views/PasswordGenerator.vue +++ b/src/views/PasswordGenerator.vue @@ -151,15 +151,17 @@ This is a password in version 1. You should update your password and use version 2
- show me the options + show me the options
diff --git a/src/views/Passwords.vue b/src/views/Passwords.vue index 49b8cf0..10aebb6 100644 --- a/src/views/Passwords.vue +++ b/src/views/Passwords.vue @@ -1,40 +1,33 @@