mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
close on click out works for background but not inside modal
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
form(v-if="task", @submit.stop.prevent="submit()")
|
form(v-if="task", @submit.stop.prevent="submit()")
|
||||||
b-modal#task-modal(size="sm", @hidden="onClose()", @show="handleOpen()", @shown="focusInput()")
|
b-modal#task-modal(v-bind:no-close-on-backdrop="showTagsSelect", size="sm", @hidden="onClose()", @show="handleOpen()", @shown="focusInput()")
|
||||||
.task-modal-header(slot="modal-header", :class="cssClass('bg')")
|
.task-modal-header(slot="modal-header", :class="cssClass('bg')")
|
||||||
.clearfix
|
.clearfix
|
||||||
h1.float-left {{ title }}
|
h1.float-left {{ title }}
|
||||||
@@ -803,6 +803,12 @@ export default {
|
|||||||
return this.selectedTags.slice(this.maxTags);
|
return this.selectedTags.slice(this.maxTags);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
document.addEventListener('click', this.handleClick);
|
||||||
|
},
|
||||||
|
destroyed () {
|
||||||
|
document.removeEventListener('click', this.handleClick);
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({saveTask: 'tasks:save', destroyTask: 'tasks:destroy', createTask: 'tasks:create'}),
|
...mapActions({saveTask: 'tasks:save', destroyTask: 'tasks:destroy', createTask: 'tasks:create'}),
|
||||||
async syncTask () {
|
async syncTask () {
|
||||||
@@ -988,6 +994,11 @@ export default {
|
|||||||
focusInput () {
|
focusInput () {
|
||||||
this.$refs.inputToFocus.focus();
|
this.$refs.inputToFocus.focus();
|
||||||
},
|
},
|
||||||
|
handleClick () {
|
||||||
|
if (this.showTagsSelect) {
|
||||||
|
this.closeTagsPopup();
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user