2018-09-12 08:22:17 +02:00
|
|
|
<template>
|
|
|
|
<transition name="modal">
|
2021-07-05 12:29:04 +02:00
|
|
|
<div class="modal-mask has-overflow" :class="{'has-overflow': overflow}">
|
|
|
|
<div class="modal-container" @mousedown.self.prevent.stop="$emit('close')" :class="{'has-overflow': overflow}">
|
2021-01-30 17:17:04 +01:00
|
|
|
<div class="modal-content" :class="{'has-overflow': overflow, 'is-wide': wide}">
|
2021-01-16 22:15:48 +01:00
|
|
|
<slot>
|
2021-01-17 18:57:57 +01:00
|
|
|
<div class="header">
|
|
|
|
<slot name="header"></slot>
|
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<slot name="text"></slot>
|
|
|
|
</div>
|
|
|
|
<div class="actions">
|
|
|
|
<x-button
|
|
|
|
@click="$emit('close')"
|
|
|
|
type="tertary"
|
|
|
|
class="has-text-danger"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('misc.cancel') }}
|
2021-01-17 18:57:57 +01:00
|
|
|
</x-button>
|
|
|
|
<x-button
|
|
|
|
@click="$emit('submit')"
|
|
|
|
type="primary"
|
|
|
|
:shadow="false"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('misc.doit') }}
|
2021-01-17 18:57:57 +01:00
|
|
|
</x-button>
|
|
|
|
</div>
|
2021-01-16 22:15:48 +01:00
|
|
|
</slot>
|
2018-09-12 08:22:17 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 22:35:52 +02:00
|
|
|
export default {
|
|
|
|
name: 'modal',
|
|
|
|
mounted: function () {
|
|
|
|
document.addEventListener('keydown', (e) => {
|
|
|
|
// Close the model when escape is pressed
|
|
|
|
if (e.keyCode === 27) {
|
|
|
|
this.$emit('close')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
2021-01-21 23:33:16 +01:00
|
|
|
props: {
|
|
|
|
overflow: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-01-30 17:17:04 +01:00
|
|
|
wide: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-01-21 23:33:16 +01:00
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
}
|
2018-09-12 08:22:17 +02:00
|
|
|
</script>
|