apxtrib/setup/data/domain/apixpress/www/cdn/public/js/article.js

25 lines
905 B
JavaScript
Raw Normal View History

2023-01-22 09:53:09 +00:00
(function($) {
$.fn.articlesaffiche = function(contenu){
$(this).html(Mustache.to_html($('#tpl_articlelist').html(),contenu)).promise().done(function(){
$('figure.article-item').on ('click',function(e){
e.preventDefault();
var data = {};
console.log($(this).find('button').attr('href').replace('.html','.json'));
$.getJSON($(this).find('button').attr('href').replace('.html','.json') , function( contenuarticle){
$('#articlecontent').html(Mustache.to_html($('#tpl_article').html(),contenuarticle))
.promise().done(function(){
$('#maincontent').css('display','none');
$('#articlecontent').css('display','block');
});
});
});
});
};
$.fn.articlemaj = function(contenu){
};
}(jQuery));