blob: 966fb46f8c1f2baf463350c60c0d2ac2449b49a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<template>
<section class="cw-block-edit">
<header v-if="preview">{{ $gettext('Bearbeiten') }}</header>
<div class="cw-block-features-content">
<div @click="exitHandler = true;">
<slot name="edit" />
</div>
<div class="cw-button-box">
<button class="button accept" @click="$emit('store'); exitHandler = false;">{{ $gettext('Speichern') }}</button>
<button class="button cancel" @click="$emit('close'); exitHandler = false;">{{ $gettext('Abbrechen') }}</button>
</div>
</div>
</section>
</template>
<script>
export default {
name: 'courseware-block-edit',
emits: ['close', 'store'],
props: {
block: Object,
preview: Boolean
},
data() {
return {
originalBlock: Object,
exitHandler: false
};
},
beforeMount() {
this.originalBlock = this.block;
},
beforeUnmount() {
if (this.exitHandler) {
this.$emit('store');
}
}
};
</script>
|