diff --git a/client/src/@types/index.ts b/client/src/@types/index.ts
index dfc3668f..ea59eef3 100644
--- a/client/src/@types/index.ts
+++ b/client/src/@types/index.ts
@@ -9,3 +9,9 @@ export interface ContentBlock {
isAssignment: boolean;
type: types;
}
+
+export interface ActionOptions {
+ up?: boolean,
+ down?: boolean,
+ extended?: boolean
+}
diff --git a/client/src/components/content-block-form/ContentBlockForm.vue b/client/src/components/content-block-form/ContentBlockForm.vue
index f5514fac..51cfb4c1 100644
--- a/client/src/components/content-block-form/ContentBlockForm.vue
+++ b/client/src/components/content-block-form/ContentBlockForm.vue
@@ -31,6 +31,7 @@
+
+
+
import ContentFormSection from '@/components/content-block-form/ContentFormSection';
import ContentElementActions from '@/components/content-block-form/ContentElementActions';
+
const TrashIcon = () => import(/* webpackChunkName: "icons" */'@/components/icons/TrashIcon');
const ContentBlockElementChooserWidget = () => import(/* webpackChunkName: "content-forms" */'@/components/content-forms/ContentBlockElementChooserWidget');
const LinkForm = () => import(/* webpackChunkName: "content-forms" */'@/components/content-forms/LinkForm');
@@ -60,8 +62,21 @@
props: {
element: {
type: Object,
- default: null
- }
+ default: null,
+ },
+ // is this element at the top level, or is it nested? we assume top level
+ topLevel: {
+ type: Boolean,
+ default: true,
+ },
+ firstElement: {
+ type: Boolean,
+ required: true,
+ },
+ lastElement: {
+ type: Boolean,
+ required: true,
+ },
},
components: {
@@ -75,10 +90,17 @@
DocumentForm,
AssignmentForm,
TextForm,
- SubtitleForm
+ SubtitleForm,
},
computed: {
+ actions() {
+ return {
+ up: !this.firstElement,
+ down: !this.lastElement,
+ extended: this.topLevel,
+ };
+ },
isChooser() {
return this.component === CHOOSER;
},
@@ -93,7 +115,7 @@
},
icon() {
return this.type.icon;
- }
+ },
},
methods: {
@@ -103,49 +125,49 @@
return {
component: 'subtitle-form',
title: 'Untertitel',
- icon: 'title-icon'
+ icon: 'title-icon',
};
case 'link_block':
return {
component: 'link-form',
title: 'Link',
- icon: 'link-icon'
+ icon: 'link-icon',
};
case 'video_block':
return {
component: 'video-form',
title: 'Video',
- icon: 'video-icon'
+ icon: 'video-icon',
};
case 'image_url_block':
return {
component: 'image-form',
title: 'Bild',
- icon: 'image-icon'
+ icon: 'image-icon',
};
case 'text_block':
return {
component: 'text-form',
title: 'Text',
- icon: 'text-icon'
+ icon: 'text-icon',
};
case 'assignment':
return {
component: 'assignment-form',
title: 'Aufgabe & Ergebnis',
- icon: 'speech-bubble-icon'
+ icon: 'speech-bubble-icon',
};
case 'document_block':
return {
component: 'document-form',
title: 'Dokument',
- icon: 'document-icon'
+ icon: 'document-icon',
};
}
return {
component: CHOOSER,
title: '',
- icon: ''
+ icon: '',
};
},
_updateProperty(value, key) {
@@ -231,7 +253,7 @@
if (convertToList) {
el = {
type: 'content_list_item',
- contents: [el]
+ contents: [el],
};
}
this.update(el);
@@ -242,7 +264,7 @@
switchToDocument(value) {
this.changeType('document_block', value);
},
- }
+ },
};
diff --git a/client/src/components/content-block-form/ContentElementActions.vue b/client/src/components/content-block-form/ContentElementActions.vue
index 2a4a2885..cc69596e 100644
--- a/client/src/components/content-block-form/ContentElementActions.vue
+++ b/client/src/components/content-block-form/ContentElementActions.vue
@@ -18,11 +18,14 @@
:large="true"
icon="arrow-thin-top"
text="Ganz nach oben verschieben"
+ :disabled="!actions.up"
+ v-if="actions.extended"
@click="emitAndClose('move-top')"
/>
@@ -56,20 +62,31 @@
-