fixed article links from audio cartel not beeing deactivate after modale close

This commit is contained in:
2018-10-23 13:11:43 +02:00
parent 8a854a45ab
commit 4071378981
2 changed files with 17 additions and 6 deletions
@@ -262,20 +262,26 @@
};
function onAjaxLoaded(data, state){
console.log('ajax loaded', state, data);
var $rendered = $(data.rendered);
$rendered.attr({
'sys_path':state.sys_path,
'view_mode': state.view_mode
});
// console.log(data);
// reset all style may been added by other pages (like masonry for productions)
// and replace all content with newly loaded
// TODO: build a system to replace or append contents (like studio + search)
if(data.entity_type == "node" && data.bundle == "evenement"){
if(_$row.find('.col.event').length){
_$row.find('.col.event').replaceWith(data.rendered);
_$row.find('.col.event').replaceWith($rendered);
}else if(_$row.find('.col.aside').length){
_$row.find('.col.aside').replaceWith(data.rendered);
_$row.find('.col.aside').replaceWith($rendered);
}else{
_$row.append(data.rendered);
_$row.append($rendered);
}
}else{
_$row.removeAttr('style').html(data.rendered);
_$row.removeAttr('style').html($rendered);
}
// add body class for currently loaded content
@@ -491,6 +497,11 @@
}
checkRowEmpty();
checkVisibleCorpusMapSpace();
// set links to this modal to not active (tested on articles from audio cartel)
if( $col.attr('view_mode') && $col.attr('sys_path')){
$('a[data-drupal-link-system-path="'+$col.attr('sys_path')+'"][viewmode="'+$col.attr('view_mode')+'"]').removeClass('is-active');
}
};
// _ _ ___ _ _