From fce78a63a56f42920ac40bbf76e67412933c8376 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 15 Aug 2016 16:31:54 +0200 Subject: [statistics] Fix list view and sorting Broken when moving JS snippets around --- .../statistics/templates/filterbox.html | 43 ++-------------------- 1 file changed, 4 insertions(+), 39 deletions(-) (limited to 'modules-available/statistics/templates/filterbox.html') diff --git a/modules-available/statistics/templates/filterbox.html b/modules-available/statistics/templates/filterbox.html index a5370a0b..544d1c48 100644 --- a/modules-available/statistics/templates/filterbox.html +++ b/modules-available/statistics/templates/filterbox.html @@ -29,7 +29,8 @@
- + + @@ -115,6 +116,8 @@ document.addEventListener("DOMContentLoaded", function () { var str = "{{{query}}}"; var eExp = /^(\w+)\s*([=>'); - $sortBtn.attr('onclick', 'toggleButton(\'' + v + '\');'); - }); -} - -function toggleButton(v) { - var $sortBtn = $('#sortButton-' + v); - var $col = $('#sortColumn'); - var $dir = $('#sortDirection'); - if ($col.val() == v) { - /* toggle direction */ - var newDir = $dir.val() == 'ASC' ? 'DESC' : 'ASC'; - $dir.val(newDir); - /* update button */ - var order = newDir == 'ASC' ? 'up' : 'down'; - $sortBtn.html(''); - } else { - /* remove "btn-success" from current sorting */ - $('#sortButton-'+v).removeClass('btn-success'); - $sortBtn.addClass('btn-success'); - $col.val(v); - $dir = 'ASC'; - } - refresh(); -} - function popupFilter(field) { if (field != null) { $('#columnSelect').val(field); @@ -258,7 +224,6 @@ function myOpSort(a,b) { } function refresh() { - console.log('refresh'); $queryForm.submit(); /* TODO: use AJAX */ } // --> -- cgit v1.2.3-55-g7522