Browse Source

story-content: Added hiding of first chapter's title if it matches story name to conserve vertical space.

1.2
Gisle Aune 6 years ago
parent
commit
68a8e7ef97
  1. 2
      marko/page/story-content/components/chapter/index.marko
  2. 6
      marko/page/story-content/components/page/index.marko

2
marko/page/story-content/components/chapter/index.marko

@ -1,6 +1,6 @@
<div class="story-chapter"> <div class="story-chapter">
<a class="anchor" id=input.chapter.id /> <a class="anchor" id=input.chapter.id />
<h1 if(input.chapter.title) class="title color-primary">${input.chapter.title}</h1>
<h1 if(input.chapter.title && !input.hideTitle) class="title color-primary">${input.chapter.title}</h1>
<div class="metadata"> <div class="metadata">
<div class="options color-menu"> <div class="options color-menu">
<if-permitted user=input.user author=input.chapter.author permission="chapter.edit"> <if-permitted user=input.user author=input.chapter.author permission="chapter.edit">

6
marko/page/story-content/components/page/index.marko

@ -19,7 +19,11 @@
so you can still read it (or back it up) before leaving the page. so you can still read it (or back it up) before leaving the page.
</p> </p>
</annotation> </annotation>
<chapter for(chapter in state.story.chapters) key=chapter.id chapter=chapter user=(!state.removed ? input.user : null) on-edit("updateChapter", chapter.id) on-remove("removeChapter", chapter.id) on-move("moveChapter", chapter) />
<chapter for(chapter in state.story.chapters) key=chapter.id
chapter=chapter
user=(!state.removed ? input.user : null)
hideTitle=(state.story.chapters[0] === chapter && chapter.title === state.story.name)
on-edit("updateChapter", chapter.id) on-remove("removeChapter", chapter.id) on-move("moveChapter", chapter) />
</div> </div>
<create-chapter-modal storyId=state.story.id enabled=(state.modal === "chapter.add") chapter=input.chapter on-close("close") on-add("addChapter") /> <create-chapter-modal storyId=state.story.id enabled=(state.modal === "chapter.add") chapter=input.chapter on-close("close") on-add("addChapter") />

Loading…
Cancel
Save