fixed active trail ajax links

This commit is contained in:
Bachir Soussi Chiadmi
2018-04-03 16:14:59 +02:00
parent ca2c673cce
commit 99b14adf07
4 changed files with 56 additions and 42 deletions
@@ -171,10 +171,10 @@
_$body.addClass('path-edlp-node');
// handle clicked link classes
_$ajaxLinks.removeClass('is-active');
$('.ajax-loading').removeClass('ajax-loading');
$('.is-active').removeClass('is-active');
$('.is-active-trail').removeClass('is-active-trail');
// TODO: break entrees links wich all have same sys_path
if(typeof selector != 'undefined'){
$('a[selector="'+selector+'"]').addClass('is-active');
}else{
@@ -183,13 +183,13 @@
// if bundle page (productions) activate production links
if (typeof data.bundle != 'undefined' && data.bundle == "page") {
$('a[data-drupal-link-system-path="productions"]').addClass('is-active');
$('a[data-drupal-link-system-path="productions"]').addClass('is-active-trail');
}
// if node is in production menu tree, set first level of tree active, e.g. pieces sonores
if (typeof data.menu_parents != 'undefined') {
for (var i = 0; i < data.menu_parents.length; i++) {
var menu_sys_path = data.menu_parents[i];
$('a[data-drupal-link-system-path="'+menu_sys_path+'"]').addClass('is-active');
$('a[data-drupal-link-system-path="'+menu_sys_path+'"]').addClass('is-active-trail');
}
}
@@ -994,14 +994,20 @@
horizontalOrder: true,
containerStyle: null,
// disable initial layout
initLayout: false,
// initLayout: false,
});
// bind event
// $grid.masonry( 'on', 'layoutComplete', function() {
// console.log('layout is complete');
// });
// layout Masonry after each image loads
$grid.imagesLoaded().progress( function() {
$grid.masonry('layout');
});
$grid.imagesLoaded(function(){
$grid.masonry();
$grid.masonry('layout');
});
}