From f8e9a99e9084ad9922e8a034d20c22e7789ad838 Mon Sep 17 00:00:00 2001 From: Joseph Guillaume Date: Thu, 10 Oct 2019 13:17:28 +1100 Subject: [PATCH] Fix Analysis.getRanges respects order of vars, #8 --- inst/www/model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/www/model.js b/inst/www/model.js index eb5527d..31de9bf 100644 --- a/inst/www/model.js +++ b/inst/www/model.js @@ -165,7 +165,7 @@ var Analysis = Backbone.Model.extend({ // Return appropriate elements return($.inArray(e[0],vars)>-1); }); - ranges.sort((e) => $.inArray(e[0],vars)); + ranges.sort((a,b) => vars.indexOf(a[0])-vars.indexOf(b[0])); if(asArray){ return(ranges); } ranges = { Variable:ranges.map(function(x){return x[0];}),