Commit c8ef1cf1 authored by Luc JEAN's avatar Luc JEAN

Fix display of the Facebook plugin block on small mobiles. Reload it dynamically

parent c62a4142
......@@ -7217,7 +7217,25 @@ a.portfolio-document-title:hover {
@media (max-width: 768px) {
.facebook-page-holder {
bottom: -100px;
bottom: -50px;
}
}
@media (max-width: 445px) {
.facebook-page-holder {
right: -15px;
margin: 0;
}
}
@media (max-width: 415px) {
.facebook-page-holder {
right: unset;
left: 0;
margin: 0;
}
.home-announce_call-background {
display: none;
}
}
......
......@@ -617,6 +617,29 @@ var fixCompetitionTimelineBlock = function() {
}
}
var addFacebookPlugin = function () {
if ($('.facebook-page-holder').length > 0) {
console.log('> addFacebookPlugin')
var pageWidth = $( document ).width();
var holderWidth = 400;
if (pageWidth < 415) {
holderWidth = pageWidth - 30
}
var fbPlugin = '' +
'<div id="fb-root"></div>\n' +
'<script async defer src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v6.0&appId=628712167150475&autoLogAppEvents=1"></script>\n' +
'<div class="fb-page" data-href="https://www.facebook.com/UlyssesNetwork"\n' +
'data-tabs="timeline" data-width="' + holderWidth + '" data-height="350" data-small-header="false"\n' +
'data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true">\n' +
'<blockquote cite="https://www.facebook.com/UlyssesNetwork" class="fb-xfbml-parse-ignore">\n' +
'<a href="https://www.facebook.com/UlyssesNetwork">Ulysses Network</a>\n' +
'</blockquote>\n' +
'</div>';
$('.facebook-page-holder').html(fbPlugin);
FB.XFBML.parse();
}
}
var onPageLoaded = function(dynamic, callback) {
$('html, body').scrollTop(0);
$('.up-to-top').hide();
......@@ -648,7 +671,7 @@ var onPageLoaded = function(dynamic, callback) {
}
);
initSelectAgeDatepicker();
initSelectAgeDatepicker();
initFileUploads();
......@@ -674,6 +697,8 @@ var onPageLoaded = function(dynamic, callback) {
initLocationSearch(false);
addFacebookPlugin();
$('body').trigger("pageLoaded");
if (callback) {
callback();
......
......@@ -23,13 +23,6 @@
<div class="row">
<div class="col-md-12">
<div class="facebook-page-holder">
<div class="fb-page" data-href="https://www.facebook.com/UlyssesNetwork"
data-tabs="timeline" data-width="400" data-height="350" data-small-header="false"
data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true">
<blockquote cite="https://www.facebook.com/UlyssesNetwork" class="fb-xfbml-parse-ignore">
<a href="https://www.facebook.com/UlyssesNetwork">Ulysses Network</a>
</blockquote>
</div>
</div>
</div>
</div>
......
......@@ -13,8 +13,6 @@
{% endblock %}
{% block content_section %}
<div id="fb-root"></div>
<script async defer src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v6.0&appId=628712167150475&autoLogAppEvents=1"></script>
{% include "web/_home/_calls.html" %}
{% include "web/_home/_members.html" %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment