Merge pull request #2066 from aignatov-bio/ai-sci-3878-fix-missing-expand-all-steps-button

Fix missing expand all button [SCI-3878]
This commit is contained in:
aignatov-bio 2019-09-18 14:59:29 +02:00 committed by GitHub
commit c652bb0d44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -267,7 +267,10 @@
if (show) { if (show) {
$("[data-action='new-step']:first").show(); $("[data-action='new-step']:first").show();
$("[data-action='edit-step']").show(); $("[data-action='edit-step']").show();
if ($('#steps .step').length > 0) $("[data-action='new-step']:last").show(); if ($('#steps .step').length > 0) {
$("[data-action='new-step']:last").show();
$(".expand-all-steps").show();
}
} else { } else {
$("[data-action='new-step']").hide(); $("[data-action='new-step']").hide();
$("[data-action='edit-step']").hide(); $("[data-action='edit-step']").hide();

View file

@ -10,8 +10,7 @@
<span class="hidden-xs"><%=t "protocols.steps.new_step" %></span> <span class="hidden-xs"><%=t "protocols.steps.new_step" %></span>
</a> </a>
</div> </div>
<% unless @protocol.steps.empty? %> <div class="pull-right expand-all-steps" style="margin: 0 15px 20px 0; display: <%= 'none' if @protocol.steps.empty? %>">
<div class="pull-right" style="margin: 0 15px 20px 0;">
<a class="btn btn-default" data-action="collapse-steps"> <a class="btn btn-default" data-action="collapse-steps">
<span class="fas fa-caret-square-up"></span> <span class="fas fa-caret-square-up"></span>
<span class="hidden-xs"><%= t("protocols.steps.collapse_label") %></a></span> <span class="hidden-xs"><%= t("protocols.steps.collapse_label") %></a></span>
@ -19,7 +18,6 @@
<span class="fas fa-caret-square-down"></span> <span class="fas fa-caret-square-down"></span>
<span class="hidden-xs"><%= t("protocols.steps.expand_label") %></a></span> <span class="hidden-xs"><%= t("protocols.steps.expand_label") %></a></span>
</div> </div>
<% end %>
</div> </div>
<% end %> <% end %>
<div id="steps"> <div id="steps">