scinote-web/app/javascript/vue/protocol/modals/delete_steps.vue

46 lines
1.5 KiB
Vue
Raw Normal View History

2022-06-24 17:21:47 +08:00
<template>
<div ref="modal" @keydown.esc="cancel" class="modal delete-steps-modal" tabindex="-1" role="dialog">
2023-02-09 22:50:25 +08:00
<div class="modal-dialog" role="document">
2022-06-24 17:21:47 +08:00
<div class="modal-content">
<div class="modal-header">
2023-08-17 19:55:17 +08:00
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="sn-icon sn-icon-close"></i></button>
2022-06-24 17:21:47 +08:00
<h4 class="modal-title">
{{ i18n.t('protocols.steps.modals.delete_steps.title')}}
</h4>
</div>
<div class="modal-body">
<p>{{ i18n.t('protocols.steps.modals.delete_steps.description_1')}}</p>
<p class="warning">{{ i18n.t('protocols.steps.modals.delete_steps.description_2')}}</p>
2022-06-24 17:21:47 +08:00
</div>
<div class="modal-footer">
<button class="btn btn-secondary" @click="cancel">{{ i18n.t('general.cancel') }}</button>
<button class="btn btn-danger" @click="confirm">{{ i18n.t('protocols.steps.modals.delete_steps.confirm')}}</button>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'deleteStepsModal',
mounted() {
2023-10-10 23:08:46 +08:00
// move modal to body to avoid z-index issues
$('body').append($(this.$refs.modal));
2022-06-24 17:21:47 +08:00
$(this.$refs.modal).modal('show');
$(this.$refs.modal).on('hidden.bs.modal', () => {
this.$emit('close');
});
},
methods: {
confirm() {
$(this.$refs.modal).modal('hide');
this.$emit('confirm');
},
cancel() {
$(this.$refs.modal).modal('hide');
}
}
}
</script>