mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-04 06:36:27 +08:00
Add collapse/expand buttons to steps [SCI-6887]
This commit is contained in:
parent
ada26d8036
commit
d62f712166
2 changed files with 18 additions and 4 deletions
|
@ -59,7 +59,15 @@
|
|||
<span class="fas fa-plus" aria-hidden="true"></span>
|
||||
<span>{{ i18n.t("protocols.steps.new_step") }}</span>
|
||||
</a>
|
||||
<a v-if="urls.reorder_steps_url" class="btn btn-default" data-toggle="modal" @click="startStepReorder">
|
||||
<button class="btn btn-light" @click="collapseSteps">
|
||||
<span class="fas fa-caret-up"></span>
|
||||
{{ i18n.t("protocols.steps.collapse_label") }}
|
||||
</button>
|
||||
<button class="btn btn-light" @click="expandSteps">
|
||||
<span class="fas fa-caret-down"></span>
|
||||
{{ i18n.t("protocols.steps.expand_label") }}
|
||||
</button>
|
||||
<a v-if="urls.reorder_steps_url" class="btn btn-light" data-toggle="modal" @click="startStepReorder">
|
||||
<span class="fas fa-arrows-alt-v" aria-hidden="true"></span>
|
||||
<span>{{ i18n.t("protocols.reorder_steps.button") }}</span>
|
||||
</a>
|
||||
|
@ -144,6 +152,12 @@
|
|||
});
|
||||
},
|
||||
methods: {
|
||||
collapseSteps() {
|
||||
$('.step-container .collapse').collapse('hide')
|
||||
},
|
||||
expandSteps() {
|
||||
$('.step-container .collapse').collapse('show')
|
||||
},
|
||||
refreshProtocolStatus() {
|
||||
if (this.inRepository) return
|
||||
// legacy method from app/assets/javascripts/my_modules/protocols.js
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
<i class="fas fa-grip-vertical"></i>
|
||||
</div>
|
||||
<a class="step-collapse-link"
|
||||
:href="'#stepBody' + step.id"
|
||||
data-toggle="collapse"
|
||||
data-remote="true">
|
||||
:href="'#stepBody' + step.id"
|
||||
data-toggle="collapse"
|
||||
data-remote="true">
|
||||
<span class="fas fa-caret-right"></span>
|
||||
</a>
|
||||
<div v-if="!inRepository" class="step-complete-container">
|
||||
|
|
Loading…
Reference in a new issue