Commit b9843a8d authored by Jérome Perrin's avatar Jérome Perrin

display the first active reporting widget

parent badf0645
......@@ -875,25 +875,37 @@
};
that.displayResult = function (idx, result) {
var active_tab = $("#reports").data("ui-tabs") ?
$("#reports").tabs("option", "active") : 0; // XXX should not be 0, but the first enabled one
$('li.result').removeClass('active');
$($('li.result')[idx]).addClass('active');
if ($("#reports").data("ui-tabs")) {
$("#reports").tabs("destroy");
}
// the list of available widgets, in the same order that in html
var available_widget_list = [
'debug_json',
'station_utilisation_graph',
'capacity_utilisation_graph',
'job_schedule_spreadsheet',
'job_gantt',
'exit_stat',
'queue_stat',
'job_schedule_spreadsheet',
'job_gantt',
'debug_json',
];
// The active tab is the one that is selected or the first one that is
// enabled
var active_tab;
if ($("#reports").data("ui-tabs")) {
active_tab = $("#reports").tabs("option", "active");
} else {
for (var i in available_widget_list) {
if (configuration['Dream-Configuration'].gui[available_widget_list[i]]) {
active_tab = i;
break;
}
}
}
$('li.result').removeClass('active');
$($('li.result')[idx]).addClass('active');
if ($("#reports").data("ui-tabs")) {
$("#reports").tabs("destroy");
}
for (var i in available_widget_list) {
var widget_name = available_widget_list[i];
if (configuration['Dream-Configuration'].gui[widget_name]) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment