fix imports js

This commit is contained in:
Tykayn 2025-06-23 00:38:13 +02:00 committed by tykayn
parent ada9fa4029
commit f785e67f49
6 changed files with 163 additions and 42 deletions

View file

@ -23,7 +23,16 @@ import './dashboard-charts.js';
import Chart from 'chart.js/auto';
import ChartDataLabels from 'chartjs-plugin-datalabels';
import maplibregl from 'maplibre-gl';
import { genererCouleurPastel, setupCitySearch, handleAddCityFormSubmit, enableLabourageForm, getLabourerUrl, adjustListGroupFontSize, toggleCompletionInfo } from './utils.js';
import {
genererCouleurPastel,
setupCitySearch,
handleAddCityFormSubmit,
enableLabourageForm,
getLabourerUrl,
adjustListGroupFontSize,
toggleCompletionInfo,
updateMapHeightForLargeScreens
} from './utils.js';
import Tablesort from 'tablesort';
window.Chart = Chart;
@ -34,6 +43,7 @@ window.getLabourerUrl = getLabourerUrl;
window.ChartDataLabels = ChartDataLabels;
window.maplibregl = maplibregl;
window.toggleCompletionInfo = toggleCompletionInfo;
window.updateMapHeightForLargeScreens = updateMapHeightForLargeScreens;
Chart.register(ChartDataLabels);
@ -41,6 +51,11 @@ Chart.register(ChartDataLabels);
document.addEventListener('DOMContentLoaded', () => {
console.log('DOMContentLoaded');
if(updateMapHeightForLargeScreens){
updateMapHeightForLargeScreens();
window.addEventListener('resize', updateMapHeightForLargeScreens);
}
const randombg = genererCouleurPastel();
// Appliquer la couleur au body
@ -184,7 +199,6 @@ document.addEventListener('DOMContentLoaded', () => {
});
}
enableLabourageForm();
enableLabourageForm();
adjustListGroupFontSize('.list-group-item');
});