Skip to content

Commit

Permalink
Redraw the trend charts when user changes color theme (dark/light mode).
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Sep 18, 2023
1 parent 6fa84cf commit b29d550
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugin/src/main/webapp/js/view-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,16 @@ const CoverageChartGenerator = function ($) {
redrawCharts();
});

if (window.getThemeManagerProperty && window.isSystemRespectingTheme) {
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
redrawCharts();

viewProxy.getOverview(function (t) {
createOverview(t.responseObject(), 'coverage-overview');
});
});
}

$(document).ready(function () {
initializeSourceCodeSelection('absolute-coverage');
initializeSourceCodeSelection('change-coverage');
Expand Down

0 comments on commit b29d550

Please sign in to comment.