Adds sticky on proposals supports for mobile version
This commit is contained in:
@@ -3,3 +3,4 @@ App.FoundationExtras =
|
||||
initialize: ->
|
||||
$(document).foundation()
|
||||
$(window).trigger "load.zf.sticky"
|
||||
$(window).trigger "resize"
|
||||
|
||||
@@ -446,6 +446,8 @@ header {
|
||||
background: $brand;
|
||||
border-bottom: 1px solid $border;
|
||||
margin-bottom: $line-height;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
|
||||
.selected {
|
||||
border-bottom: 1px solid #fff;
|
||||
|
||||
@@ -551,6 +551,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
.fixed-mobile-content {
|
||||
|
||||
@include breakpoint(medium down) {
|
||||
background: #fff;
|
||||
margin-bottom: rem-calc(-1) !important;
|
||||
padding-top: $line-height / 2;
|
||||
}
|
||||
}
|
||||
|
||||
// 04. List participation
|
||||
// ----------------------
|
||||
|
||||
|
||||
@@ -62,30 +62,44 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="sidebar-divider"></div>
|
||||
<h2><%= t("votes.supports") %></h2>
|
||||
<div id="<%= dom_id(@proposal) %>_votes">
|
||||
<% if @proposal.draft? %>
|
||||
<div class="callout primary">
|
||||
<p class=text-center><strong><%= t('.draft') %></strong></p>
|
||||
<div id="proposal_sticky" data-sticky-container>
|
||||
<div class="sticky fixed-mobile-content"
|
||||
data-sticky
|
||||
data-stick-to="bottom"
|
||||
data-sticky-on="small"
|
||||
data-top-anchor="0"
|
||||
data-btm-anchor="sticky_stop:top">
|
||||
<div class="fixed-mobile-content">
|
||||
<div class="sidebar-divider"></div>
|
||||
<h2><%= t("votes.supports") %></h2>
|
||||
|
||||
<div id="<%= dom_id(@proposal) %>_votes">
|
||||
<% if @proposal.draft? %>
|
||||
<div class="callout primary">
|
||||
<p class=text-center><strong><%= t('.draft') %></strong></p>
|
||||
</div>
|
||||
<% elsif @proposal.successful? %>
|
||||
<p>
|
||||
<%= t("proposals.proposal.successful") %>
|
||||
</p>
|
||||
<% elsif @proposal.archived? %>
|
||||
<div class="padding text-center">
|
||||
<p>
|
||||
<strong><%= t("proposals.proposal.supports", count: @proposal.total_votes) %></strong>
|
||||
</p>
|
||||
<p><%= t("proposals.proposal.archived") %></p>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render "votes",
|
||||
{ proposal: @proposal, vote_url: vote_proposal_path(@proposal, value: "yes") } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif @proposal.successful? %>
|
||||
<p>
|
||||
<%= t("proposals.proposal.successful") %>
|
||||
</p>
|
||||
<% elsif @proposal.archived? %>
|
||||
<div class="padding text-center">
|
||||
<p>
|
||||
<strong><%= t("proposals.proposal.supports", count: @proposal.total_votes) %></strong>
|
||||
</p>
|
||||
<p><%= t("proposals.proposal.archived") %></p>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render "votes",
|
||||
{ proposal: @proposal, vote_url: vote_proposal_path(@proposal, value: "yes") } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sticky_stop"></div>
|
||||
|
||||
<%= render "proposals/social_share", proposal: @proposal, share_title: t("proposals.show.share") %>
|
||||
|
||||
<% if current_user %>
|
||||
|
||||
Reference in New Issue
Block a user