Skip to content

Commit

Permalink
Remove newline to show FB and Twitter buttons on same line publiclab#…
Browse files Browse the repository at this point in the history
…4821 (publiclab#4867)

* Remove newline to show FB and Twitter buttons on same line publiclab#4821

Removing <br> tag was not simply enough, since facebook button root node is a div with display block.
I am not that happy with this solution, because it relies on how Facebook renders its button, which can change at any time.
Other solution I came up with was adding float:left and margin-right to twitter button, then it does not matter that Facebook button is block element, but still it relies on how twitter's script renders its button in iframe.
Last solution I came up, but could not make work was wrapping both of them in divs and then position them based on our containers div with no regard what is inside.

* Change solution to indepent of internals of social media buttons

* Update app/views/sidebar/_dashboard.html.erb

Typo, closing tag.

Co-Authored-By: swiatek7 <swiatek7@gmail.com>
  • Loading branch information
matvs authored and grvsachdeva committed Feb 21, 2019
1 parent 96c8e34 commit dc24fcf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions app/assets/stylesheets/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@
margin: 18px 0 2px;
}

.dashboard .social-media-btn {
float: left;
margin-right: 5px;
}

.note-default {

}
Expand Down
11 changes: 7 additions & 4 deletions app/views/sidebar/_dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@
<% cache('feature_dashboard-sidebar', skip_digest: true) do %>
<%= feature('dashboard-sidebar') %>
<% end %>
<!-- Twitter follow bitton, options can be adjusted here: https://publish.twitter.com/# -->
<a href="https://twitter.com/PublicLab?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-size="large" data-show-count="false">Follow @PublicLab</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<br>
<!-- Twitter follow button, options can be adjusted here: https://publish.twitter.com/# -->
<div class="social-media-btn">
<a href="https://twitter.com/PublicLab?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-size="large" data-show-count="false">Follow @PublicLab</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
<!-- Facebook like button, options can be adjusted here: https://developers.facebook.com/docs/plugins/like-button/ -->
<div class="fb-like" data-href="https://www.facebook.com/PublicLab/" data-layout="button_count" data-action="like" data-size="large" data-show-faces="false" data-share="false"></div>
<div class="social-media-btn">
<div class="fb-like" data-href="https://www.facebook.com/PublicLab/" data-layout="button_count" data-action="like" data-size="large" data-show-faces="false" data-share="false"></div>
</div>
</div>
</div>

0 comments on commit dc24fcf

Please sign in to comment.