Commit ec989ddd authored by Exbrayat Cédric's avatar Exbrayat Cédric
Browse files

chore: format with prettier

parent a53e21d9
......@@ -8,7 +8,8 @@
"build:prod": "webpack --mode production",
"watch": "webpack --mode development --watch",
"watch:prod": "webpack --mode production --watch",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write \"src/**/*.+(ts|js|json|html|scss)\""
},
"author": "",
"license": "MIT",
......@@ -28,6 +29,7 @@
"mini-css-extract-plugin": "2.2.2",
"postcss": "8.3.6",
"postcss-loader": "6.1.1",
"prettier": "2.3.2",
"sass": "1.39.0",
"sass-loader": "12.1.0",
"ts-loader": "9.2.5",
......@@ -37,5 +39,11 @@
},
"browserslist": [
"defaults"
]
],
"prettier": {
"printWidth": 140,
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "none"
}
}
import { Popover } from 'bootstrap';
export function initializePopovers() {
const popoverTriggerList: Array<HTMLElement> = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
const popoverTriggerList: Array<HTMLElement> = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
popoverTriggerList.forEach(popoverTriggerEl => {
const options: Partial<Popover.Options> = {};
const contentSelector = popoverTriggerEl.dataset.bsElement;
......
......@@ -4,4 +4,4 @@ import { initializeMap } from './map/map';
(window as any).faidare = {
initializePopovers,
initializeMap
}
};
......@@ -36,11 +36,12 @@ export function initializeMap(options: MapOptions) {
}
const mapContainerElement = document.querySelector('#map-container');
mapContainerElement!.classList.remove("d-none");
mapContainerElement!.classList.remove('d-none');
const mapElement = document.querySelector('#map') as HTMLElement;
const map = L.map(mapElement);
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; Esri &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, ' +
attribution:
'Tiles &copy; Esri &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, ' +
'Esri China (Hong Kong), Esri (Thailand), TomTom, 2012'
}).addTo(map);
......@@ -52,7 +53,7 @@ export function initializeMap(options: MapOptions) {
for (const location of options.locations) {
const icon = L.icon({
iconUrl: markerIconUrl(options.contextPath, location),
iconAnchor: [12, 41], // point of the icon which will correspond to marker's location
iconAnchor: [12, 41] // point of the icon which will correspond to marker's location
});
const popupElement = document.createElement('div');
......@@ -74,10 +75,7 @@ export function initializeMap(options: MapOptions) {
linkElement.href = `${options.contextPath}/sites/${location.locationDbId}`;
popupElement.appendChild(linkElement);
const marker = L.marker(
[location.latitude, location.longitude],
{ icon: icon }
);
const marker = L.marker([location.latitude, location.longitude], { icon: icon });
markers.addLayer(marker.bindPopup(popupElement));
mapMarkers.push(marker);
}
......
......@@ -12,7 +12,7 @@ $table-group-separator-color: $table-border-color;
@import '~leaflet.markercluster/dist/MarkerCluster.css';
@import '~leaflet.markercluster/dist/MarkerCluster.Default.css';
a[role=button] {
a[role='button'] {
color: $link-color !important;
}
......
......@@ -1736,6 +1736,11 @@ postcss@8.3.6, postcss@^8.2.15, postcss@^8.3.5:
nanoid "^3.1.23"
source-map-js "^0.6.2"
prettier@2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d"
integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==
punycode@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
......
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