created production menu block, styled links, ajaxified links
This commit is contained in:
@@ -39,19 +39,25 @@
|
||||
// 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);
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
@@ -80,7 +86,7 @@
|
||||
};
|
||||
|
||||
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
|
||||
@@ -95,10 +101,11 @@
|
||||
$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();
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user