Fix button below chapter title
This commit is contained in:
parent
228def84b4
commit
b6ef5b2e34
|
|
@ -18,26 +18,48 @@
|
|||
const AddPointer = () => import(/* webpackChunkName: "icons" */'@/components/icons/AddPointer');
|
||||
|
||||
export default {
|
||||
props: ['after', 'parent'],
|
||||
props: {
|
||||
where: {
|
||||
type: Object,
|
||||
validator(prop) {
|
||||
return Object.prototype.hasOwnProperty.call(prop, 'after' )
|
||||
|| Object.prototype.hasOwnProperty.call(prop, 'parent');
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
components: {
|
||||
AddPointer
|
||||
},
|
||||
|
||||
computed: {
|
||||
parent() {
|
||||
return this.where.parent;
|
||||
},
|
||||
after() {
|
||||
return this.where.after;
|
||||
},
|
||||
isObjectiveGroup() {
|
||||
return this.parent && this.parent.__typename === 'ObjectiveGroupNode';
|
||||
},
|
||||
slug() {
|
||||
return this.$route.params.slug;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
addContent() {
|
||||
if (this.parent && this.parent.__typename === 'ObjectiveGroupNode') {
|
||||
if (this.isObjectiveGroup) {
|
||||
this.$store.dispatch('addObjective', this.parent.id);
|
||||
} else {
|
||||
let route;
|
||||
const slug = this.$route.params.slug;
|
||||
if (this.after.id) {
|
||||
if (this.after && this.after.id) {
|
||||
route = {
|
||||
name: CREATE_CONTENT_BLOCK_AFTER_PAGE,
|
||||
params: {
|
||||
after: this.after.id,
|
||||
slug
|
||||
slug: this.slug
|
||||
}
|
||||
};
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
</div>
|
||||
|
||||
<add-content-button
|
||||
:parent="chapter"
|
||||
:where="{parent: chapter}"
|
||||
v-if="editMode"
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
</div>
|
||||
|
||||
<add-content-button
|
||||
:after="contentBlock"
|
||||
:where="{after: contentBlock}"
|
||||
v-if="canEditModule"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "@/styles/_variables.scss";
|
||||
@import "~styles/variables";
|
||||
|
||||
.document-form {
|
||||
&__uploaded {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
</ul>
|
||||
<add-content-button
|
||||
:parent="group"
|
||||
:where="{parent: group}"
|
||||
v-if="editMode"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue