make sure javascript code is only executed on real gadjo pages (#12887)

This commit is contained in:
Frédéric Péters 2016-08-20 11:33:32 +02:00
parent 50e078ba64
commit 11e4f3588e
2 changed files with 8 additions and 6 deletions

View File

@ -303,11 +303,13 @@ var gadjo_js = gadjo_js || {};
});
});
$(function () {
if ($('#sidepage').length == 1) {
$('body').attr('data-has-sidebar', 'true');
if ($('body').data('gadjo')) {
if ($('#sidepage').length == 1) {
$('body').attr('data-has-sidebar', 'true');
}
/* 440 is header image height (500px) - header height (60px) */
var timestamp = ((new Date().getTime() / 1000) % 86400 ) / (86400 / 440);
$('div#header').css('background-position', '0 -' + timestamp + 'px');
}
/* 440 is header image height (500px) - header height (60px) */
var timestamp = ((new Date().getTime() / 1000) % 86400 ) / (86400 / 440);
$('div#header').css('background-position', '0 -' + timestamp + 'px');
});
})();

View File

@ -18,7 +18,7 @@
{% block extrascripts %}
{% endblock %}
</head>
<body {% block bodyargs %}{% endblock %}>
<body data-gadjo="true" {% block bodyargs %}{% endblock %}>
<div id="top">
{% block sidepage %}
<div id="sidepage">