Commit b291b18a by Torkel Ödegaard

Unsaved changes improvements: ignore row collapse state, ignore graph legend…

Unsaved changes improvements: ignore row collapse state, ignore graph legend sort order, Closes #1702
parent e6492f7d
......@@ -73,7 +73,7 @@ function (angular, $, kbn, _, moment) {
for (i = 0; i < this.rows.length; i++) {
row = this.rows[i];
for (j = 0; j < row.panels.length; j++) {
callback(row.panels[j], row);
callback(row.panels[j], j, row, i);
}
}
};
......
......@@ -101,6 +101,25 @@ function(angular, _, config) {
}
});
// ignore some panel and row stuff
current.forEachPanel(function(panel, panelIndex, row, rowIndex) {
var originalRow = original.rows[rowIndex];
var originalPanel = original.getPanelById(panel.id);
// ignore row collapse state
if (originalRow) {
row.collapse = originalRow.collapse;
}
if (originalPanel) {
// ignore graph legend sort
if (originalPanel.legend && panel.legend) {
delete originalPanel.legend.sortDesc;
delete originalPanel.legend.sort;
delete panel.legend.sort;
delete panel.legend.sortDesc;
}
}
});
var currentTimepicker = _.findWhere(current.nav, { type: 'timepicker' });
var originalTimepicker = _.findWhere(original.nav, { type: 'timepicker' });
......
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