diff options
author | Simon Rettberg | 2016-06-24 14:24:00 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-06-24 14:24:00 +0200 |
commit | 43281909e652d651e8d5b721b440ea5c6eaf8798 (patch) | |
tree | cd802be78717f79114de2924e6d6615cea3866ed /modules-available/exams/templates/page-exams.html | |
parent | [exams] Move to content group; fix timepicker; mark old exams (diff) | |
download | slx-admin-43281909e652d651e8d5b721b440ea5c6eaf8798.tar.gz slx-admin-43281909e652d651e8d5b721b440ea5c6eaf8798.tar.xz slx-admin-43281909e652d651e8d5b721b440ea5c6eaf8798.zip |
[exams] Indent location by tree depth; fix ordering of locations in vis.js
Diffstat (limited to 'modules-available/exams/templates/page-exams.html')
-rw-r--r-- | modules-available/exams/templates/page-exams.html | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules-available/exams/templates/page-exams.html b/modules-available/exams/templates/page-exams.html index d0be479d..45ec0b50 100644 --- a/modules-available/exams/templates/page-exams.html +++ b/modules-available/exams/templates/page-exams.html @@ -43,8 +43,14 @@ <script type="application/javascript"><!-- -function customOrder(a, b) { - return 1000; // just in order of appeareance +function itemOrderFun(a, b) { + return a.content.localeCompare(b.content); +} + +function groupOrderFun(a, b) { + var s = a.sortIndex - b.sortIndex; + if (s != 0) return s; + return itemOrderFun(a, b); } document.addEventListener("DOMContentLoaded", function () { @@ -67,7 +73,8 @@ document.addEventListener("DOMContentLoaded", function () { 'max' : {{vis_max_date}}, 'zoomMin': 6 * 3600 * 1000, 'zoomMax': 2 * 86400 * 1000, - 'order' : customOrder, + 'order' : itemOrderFun, + 'groupOrder' : groupOrderFun, 'locale' : language, 'moment' : function(date) { return vis.moment(date).utc(); } }; |