Graph: small fix to legend sorting, #1030

This commit is contained in:
Torkel Ödegaard 2014-11-12 10:19:33 +01:00
parent 0b966b7a28
commit 1c0fc3c924
2 changed files with 6 additions and 1 deletions

View File

@ -56,7 +56,11 @@ function (angular, app, _, kbn, $) {
function sortLegend(e) {
var el = $(e.currentTarget);
var stat = el.data('stat');
if (stat !== panel.legend.sort) { panel.legend.sortDesc = null; }
// if already sort ascending, disable sorting
if (panel.legend.sortDesc === false) {
panel.legend.sort = null;
panel.legend.sortDesc = null;
@ -65,7 +69,7 @@ function (angular, app, _, kbn, $) {
}
panel.legend.sortDesc = !panel.legend.sortDesc;
panel.legend.sort = el.data('stat');
panel.legend.sort = stat;
render();
}

View File

@ -114,6 +114,7 @@
font-weight: bold;
color: @blue;
font-size: 85%;
white-space: nowrap;
}
}