diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-09-02 12:48:43 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-09-02 12:48:43 -0400 |
| commit | 5052d51aa4c55eabc736b3c76a783db2f5208289 (patch) | |
| tree | f8579c8698471a98713e53bf4f07e5e570a55df4 /themes/okadmin/public/js/app.js | |
| parent | 14094a0f9082e1eaf22d1864a52e21c69c965f3d (diff) | |
fix sorting issue on groupBy elementsv0.1.39
Diffstat (limited to 'themes/okadmin/public/js/app.js')
| -rw-r--r-- | themes/okadmin/public/js/app.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index d65fcc6..9891298 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -303,10 +303,16 @@ var OKAdmin = function(){ $(".resource-category.root").on("submit", "form", function(e) { var $parent = $(e.delegateTarget); var $resources = $parent.find(".resource-input") + var isDescending = $parent.hasClass("descending") $resources.each(function(index) { var $input = $(this); var parsed = JSON.parse($input.val()); - parsed.__index = index; + if (isDescending) { + parsed.__index = $resources.length - index; + } + else { + parsed.__index = index; + } $input.val(JSON.stringify(parsed)); }) }); |
