created production menu block, styled links, ajaxified links

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-02 18:56:08 +01:00
parent 80afea9c7d
commit 55f5d5b2f0
7 changed files with 127 additions and 33 deletions
@@ -62,19 +62,25 @@ edlp_vars = {
// TODO: implement history.js
function initAjaxLinks(){
console.log('initAjaxLinks');
$('a', '#block-mainnavigation, #block-footer.menu--footer').addClass('ajax-link');
$('a', '#block-mainnavigation, #block-footer.menu--footer, #block-productions').addClass('ajax-link');
_$ajaxLinks = $('.ajax-link')
.each(function(i,e){
var $this = $(this);
// avoid already ajaxified links
if($this.is('.ajax-enable'))
return;
var sys_path = $this.attr('data-drupal-link-system-path');
if(sys_path){
// convert node link to edlp_ajax_node module links
m = sys_path.match(/^\/?(node\/\d+)$/g);
if(m) $this.attr('data-drupal-link-system-path', 'edlp/'+m[0]);
}
$this.on('click', onClickAjaxLink).addClass('ajax-enable');
})
.on('click', onClickAjaxLink);
;
};
@@ -103,7 +109,7 @@ edlp_vars = {
};
function onAjaxLinkLoaded(data, $link, sys_path){
console.log('ajax link loaded : data', data);
console.log('ajax link loaded');
_$content_container.html(data.rendered);
_$body.removeClass('ajax-loading');
// add body class for currently loaded content
@@ -118,10 +124,11 @@ edlp_vars = {
$link.removeClass('ajax-loading').addClass('is-active');
initScrollbars();
console.log(sys_path);
if(sys_path == "productions"){
window.requestAnimationFrame(initProductions);
}
if(sys_path == "productions")
initProductions();
initAjaxLinks();
};
@@ -1405,6 +1405,32 @@ footer {
font-size: 0.756em; }
footer .block-language ul li.is-active a {
color: red; }
footer #block-productions ul {
white-space: nowrap; }
footer #block-productions ul li a {
pointer-events: all;
background-color: #fff;
padding-right: 0.4em; }
footer #block-productions ul li a:before {
content: "";
display: inline-block;
width: 7px;
height: 7px;
border: 1px solid red;
margin-right: 0.5em; }
footer #block-productions ul li a:hover:before {
background-color: red; }
footer #block-productions ul li a.ajax-loading:before {
-webkit-animation: rotation 2s infinite linear;
animation: rotation 2s infinite linear; }
@keyframes rotation {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
to {
-webkit-transform: rotate(359deg);
transform: rotate(359deg); } }
footer .block-block-edlp-entrees {
display: inline-block; }
footer .block-block-edlp-entrees ul {