X-Git-Url: https://git.mdrn.pl/ReadingsJQM.git/blobdiff_plain/c956fba7332f45e9abab07b2b8ac417b0f6514c8..bdd9d26375a6489d7ff8eac944e29b0789f04a20:/js/app/app.js diff --git a/js/app/app.js b/js/app/app.js index c5a9521..b5e2ba2 100644 --- a/js/app/app.js +++ b/js/app/app.js @@ -28,7 +28,9 @@ 'genres': 'gatunek', 'kinds': 'rodzaj', 'themes': 'motyw' - } + }, + show_filter: ['authors', 'themes'], + show_dividers: ['authors', 'themes'] }); return Readings.initialized = true; }; @@ -40,11 +42,21 @@ rcategory = /category=(\w+)/; - $(document).on('pageshow', "#page-tags", function(ev, ui) { + $(document).on('pageinit', "#page-tags", function(ev, ui) { var category; category = rcategory.exec($(this).attr('data-url')); if ((category != null) && (category[1] != null)) { - return $(this).Readings('TagList', category[1]); + return $(this).Readings('list', { + category: category[1], + url: Readings.config.get('wlurl') + ("/api/" + category[1]), + filter: Readings.config.get('show_filter').indexOf(category[1]) >= 0, + mapper: function(rec) { + return new Readings.Tag(rec, category[1]); + }, + dividers: Readings.config.get('show_dividers').indexOf(category[1]) >= 0 + }); + } else { + return alert('no category in query string'); } });