Skip to content

Commit

Permalink
Merge pull request #336 from LibCrowds/add-footer-slot
Browse files Browse the repository at this point in the history
Add footer slot
  • Loading branch information
alexandermendes authored May 22, 2018
2 parents b925a9f + db6f610 commit 87a0c4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 5 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ In `transcribe` mode, the form can be configured with the following properties.

The following slots are available.

| Name | Description |
|--------|------------------------------------------------------------------|
| help | Slots in above the viewer controls section in the help model |
| info | Content for the info modal (overwrites `task.manifest`) |
| Name | Description |
|--------|----------------------------------------------------------------------|
| help | Slots in above the viewer controls section in the help model |
| info | Content for the info modal (overwrites `task.manifest`) |
| footer | Add items into the sidebar footer, above the submit and note buttons |


## Styles
Expand Down
4 changes: 4 additions & 0 deletions src/components/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
@enableviewer="viewerDisabled = false">

<select-sidebar-item
slot="content"
v-if="taskLoaded && currentTask.mode === 'select'"
:task="currentTask"
:tags="tags"
Expand All @@ -129,6 +130,7 @@
</select-sidebar-item>

<transcribe-sidebar-item
slot="content"
v-if="currentTask.mode === 'transcribe'"
:task="currentTask"
:disableComplete="disableComplete"
Expand All @@ -138,6 +140,8 @@
@inputblur="onTranscribeInputBlur">
</transcribe-sidebar-item>

<slot name="footer"></slot>

</base-sidebar>
</main>

Expand Down
6 changes: 5 additions & 1 deletion src/components/sidebars/Base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
</header>

<main key="content" :class="contentClass">
<slot></slot>
<slot name="content"></slot>
</main>

<footer key="footer" class="lv-sidebar-footer">

<!-- Passed from main viewer's footer slot -->
<slot></slot>

<span v-if="!showConfirmButtons">
<button
v-if="buttons.note"
Expand Down

0 comments on commit 87a0c4b

Please sign in to comment.