responive header and footer ready (remains centering entree block

This commit is contained in:
2018-04-25 20:09:49 +02:00
parent 551ff35344
commit aa55ae2e35
10 changed files with 4865 additions and 251 deletions
@@ -27,11 +27,13 @@
if(!drupalSettings.path.isFront)
return;
_deferred = initEvents();
initEvents();
_audioPlayer = new AudioPlayer();
_compoPlayer = new CompoPlayer();
checkLayout();
initAjaxLinks();
initHistory();
@@ -76,7 +78,7 @@
.on('open_entree', function(e){
console.log('on_open_entree : e', e);
closeAllModals();
checkLayout();
// add body class for currently loaded content
// var body_classes = [
// 'path-'+sys_path.replace(/\//g, '-'),
@@ -88,11 +90,6 @@
// record new history state
if(typeof e.url != 'undefined'){
// var state = {
// ajax_path:null,
// sys_path:null,
// entree_tid:e.tid
// };
var state = getSysPathState(e.sys_path);
history.pushState(state, null, e.url);
@@ -103,17 +100,38 @@
_paq.push(['setCustomUrl', e.url]);
_paq.push(['setDocumentTitle', e.title]);
_paq.push(['trackPageView']);
// js event
// trackEvent(category, action, [name], [value])
// _paq.push(['trackEvent', 'AjaxNav', 'loaded', state.url]);
}
}
})
.on('close_entree', function(e){
backToFrontPage();
checkLayout();
});
window.addEventListener('resize', checkLayout, false);
}
// __ ___ _ ___ _
// \ \ / (_)_ _ __| |_____ __ __ | _ \___ __(_)______
// \ \/\/ /| | ' \/ _` / _ \ V V / | / -_|_-< |_ / -_)
// \_/\_/ |_|_||_\__,_\___/\_/\_/ |_|_\___/__/_/__\___|
function checkLayout(){
var $audioplayer = $("#audio-player");
if($audioplayer.length){
var navpos = $('#block-mainnavigation').position();
console.log('navpos', navpos);
$audioplayer.css({
'width':navpos.left+'px'
});
}
// entrees
// TODO: center the entrees menu
};
// ___ _ _ ___
// / __| __ _ _ ___| | | _ ) __ _ _ _ ___
// \__ \/ _| '_/ _ \ | | _ \/ _` | '_(_-<