Skip to content

Commit

Permalink
sort query version select options (re getredash#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
spasovski authored and Allen Short committed Jan 8, 2018
1 parent 9f665c6 commit 7bc7f0a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions client/app/pages/queries/compare-query-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ const CompareQueryDialog = {

$http.get(`/api/queries/${this.currentQuery.id}/version`).then((response) => {
this.versions = response.data;

const compare = (a, b) => {
if (a.object_version < b.object_version) {
return -1;
} else if (a.object_version > b.object_version) {
return 1;
}
return 0;
};

this.versions.sort(compare);
this.compareQueries(true);
});
}],
Expand Down

0 comments on commit 7bc7f0a

Please sign in to comment.