diff --git a/kfet/static/kfet/js/kpsul.js b/kfet/static/kfet/js/kpsul.js index e3621dee..b2b4c5fa 100644 --- a/kfet/static/kfet/js/kpsul.js +++ b/kfet/static/kfet/js/kpsul.js @@ -373,11 +373,11 @@ class ArticleManager { constructor(env) { this._env = env; // Global K-Psul Manager - this._$container = $('#articles_data tbody'); + this._$container = $('#articles_data'); this._$input = $('#article_autocomplete'); this._$nb = $('#article_number'); - this.templates = {'category': '', - 'article' : ''} + this.templates = {'category': '
', + 'article' : '
'} this.selected = new Article() ; this.list = new ArticleList() ; @@ -410,7 +410,7 @@ class ArticleManager { } reset_data() { - this._$container.find('tr').remove(); + this._$container.html(''); this.list.clear(); this.list.fromAPI({}, this.display_list.bind(this), $.noop) ; } @@ -450,10 +450,11 @@ class ArticleManager { }); this._$container.on('click', '.article', function() { - var id = $(this).attr('data-article-id') ; - var article = that.list.find(Article, { 'id': intCheck(id) }); + var id = $(this).parent().attr('id').split('-')[1]; + console.log(id); + var article = that.list.find('article', id); if (article) - that.validate(article); + that.validate(article.content); }); this._$nb.on('keydown', function(e) {