fixed article links from audio cartel not beeing deactivate after modale close
This commit is contained in:
@@ -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');
|
||||
}
|
||||
};
|
||||
|
||||
// _ _ ___ _ _
|
||||
|
||||
Reference in New Issue
Block a user