Clean up code

This commit is contained in:
Ramon Wenger 2021-02-22 14:29:21 +01:00
parent fae3043c3b
commit 322d7725f2
4 changed files with 7 additions and 8 deletions

View File

@ -3,7 +3,7 @@
:data-scrollto="chapter.id" :data-scrollto="chapter.id"
class="chapter"> class="chapter">
<div <div
:class="{'hideable-element--hidden': titleGreyedOut}" :class="{'hideable-element--greyed-out': titleGreyedOut}"
class="hideable-element" class="hideable-element"
v-if="!titleHidden"> v-if="!titleHidden">
<h3 <h3
@ -26,7 +26,7 @@
@bookmark="bookmark(!chapter.bookmark)" @bookmark="bookmark(!chapter.bookmark)"
/> />
<div <div
:class="{'hideable-element--hidden': descriptionGreyedOut}" :class="{'hideable-element--greyed-out': descriptionGreyedOut}"
class="chapter__intro intro hideable-element" class="chapter__intro intro hideable-element"
v-if="!descriptionHidden" v-if="!descriptionHidden"
> >
@ -97,10 +97,9 @@ export default {
})); }));
}, },
note() { note() {
if (!(this.chapter && this.chapter.bookmark)) { if (this.chapter && this.chapter.bookmark) {
return; return this.chapter.bookmark.note;
} }
return this.chapter.bookmark.note;
}, },
titleGreyedOut() { titleGreyedOut() {
return this.textHidden(CHAPTER_TITLE_TYPE) && this.editModule; return this.textHidden(CHAPTER_TITLE_TYPE) && this.editModule;

View File

@ -1,6 +1,6 @@
<template> <template>
<div <div
:class="{'hideable-element--hidden': hidden}" :class="{'hideable-element--greyed-out': hidden}"
class="content-block__container hideable-element"> class="content-block__container hideable-element">
<div <div
:class="specialClass" :class="specialClass"

View File

@ -1,6 +1,6 @@
<template> <template>
<li <li
:class="{'hideable-element--hidden': hidden}" :class="{'hideable-element--greyed-out': hidden}"
class="objective hideable-element" class="objective hideable-element"
v-if="editModule || !hidden"> v-if="editModule || !hidden">
<visibility-action <visibility-action

View File

@ -1,7 +1,7 @@
.hideable-element { .hideable-element {
position: relative; position: relative;
&--hidden { &--greyed-out {
&::before { &::before {
content: ''; content: '';
position: absolute; position: absolute;