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');
|
const AddPointer = () => import(/* webpackChunkName: "icons" */'@/components/icons/AddPointer');
|
||||||
|
|
||||||
export default {
|
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: {
|
components: {
|
||||||
AddPointer
|
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: {
|
methods: {
|
||||||
addContent() {
|
addContent() {
|
||||||
if (this.parent && this.parent.__typename === 'ObjectiveGroupNode') {
|
if (this.isObjectiveGroup) {
|
||||||
this.$store.dispatch('addObjective', this.parent.id);
|
this.$store.dispatch('addObjective', this.parent.id);
|
||||||
} else {
|
} else {
|
||||||
let route;
|
let route;
|
||||||
const slug = this.$route.params.slug;
|
if (this.after && this.after.id) {
|
||||||
if (this.after.id) {
|
|
||||||
route = {
|
route = {
|
||||||
name: CREATE_CONTENT_BLOCK_AFTER_PAGE,
|
name: CREATE_CONTENT_BLOCK_AFTER_PAGE,
|
||||||
params: {
|
params: {
|
||||||
after: this.after.id,
|
after: this.after.id,
|
||||||
slug
|
slug: this.slug
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<add-content-button
|
<add-content-button
|
||||||
:parent="chapter"
|
:where="{parent: chapter}"
|
||||||
v-if="editMode"
|
v-if="editMode"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<add-content-button
|
<add-content-button
|
||||||
:after="contentBlock"
|
:where="{after: contentBlock}"
|
||||||
v-if="canEditModule"
|
v-if="canEditModule"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "@/styles/_variables.scss";
|
@import "~styles/variables";
|
||||||
|
|
||||||
.document-form {
|
.document-form {
|
||||||
&__uploaded {
|
&__uploaded {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<add-content-button
|
<add-content-button
|
||||||
:parent="group"
|
:parent="group"
|
||||||
|
:where="{parent: group}"
|
||||||
v-if="editMode"
|
v-if="editMode"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue