chore: refactor help.button arguments

This commit is contained in:
Yohan Boniface 2024-07-05 18:27:53 +02:00
parent ec5f8d7b3c
commit 207860ecf5
2 changed files with 16 additions and 21 deletions

View file

@ -213,25 +213,20 @@ export default class Help {
this.map.dialog.open({ content: container, className: 'dark' })
}
button(container, entries, classname) {
button(container, entries) {
const button = DomUtil.createButton(
classname || 'umap-help-button',
'umap-help-button',
container,
translate('Help')
)
entries = typeof entries === 'string' ? [entries] : entries
DomEvent.on(button, 'click', DomEvent.stop).on(button, 'click', () => {
this.show(entries)
})
button.addEventListener('click', () => this.show(entries))
return button
}
getStartedLink(container) {
const button = DomUtil.createButton('umap-help-link', container, translate('Help'))
button.textContent = translate('Help')
DomEvent.on(button, 'click', DomEvent.stop).on(button, 'click', () => {
this.showGetStarted()
})
button.addEventListener('click', () => this.showGetStarted())
return button
}

View file

@ -45,7 +45,7 @@ export const SCHEMA = {
impacts: ['data'],
handler: 'ColorPicker',
label: translate('color'),
helpEntries: 'colorValue',
helpEntries: ['colorValue'],
inheritable: true,
default: 'DarkBlue',
},
@ -65,7 +65,7 @@ export const SCHEMA = {
type: String,
impacts: ['data'],
label: translate('dash array'),
helpEntries: 'dashArray',
helpEntries: ['dashArray'],
inheritable: true,
},
datalayersControl: {
@ -92,7 +92,7 @@ export const SCHEMA = {
type: 'Text',
impacts: ['ui'],
label: translate('description'),
helpEntries: 'textFormatting',
helpEntries: ['textFormatting'],
},
displayOnLoad: {
type: Boolean,
@ -131,7 +131,7 @@ export const SCHEMA = {
type: Boolean,
impacts: ['data'],
label: translate('fill'),
helpEntries: 'fill',
helpEntries: ['fill'],
inheritable: true,
default: true,
},
@ -140,7 +140,7 @@ export const SCHEMA = {
impacts: ['data'],
handler: 'ColorPicker',
label: translate('fill color'),
helpEntries: 'fillColor',
helpEntries: ['fillColor'],
inheritable: true,
},
fillOpacity: {
@ -216,7 +216,7 @@ export const SCHEMA = {
type: Boolean,
impacts: ['data'],
label: translate('Allow interactions'),
helpEntries: 'interactive',
helpEntries: ['interactive'],
inheritable: true,
default: true,
},
@ -243,7 +243,7 @@ export const SCHEMA = {
labelKey: {
type: String,
impacts: ['data'],
helpEntries: 'labelKey',
helpEntries: ['labelKey'],
placeholder: translate('Default: name'),
label: translate('Label key'),
inheritable: true,
@ -319,7 +319,7 @@ export const SCHEMA = {
type: String,
impacts: [],
label: translate('Link to…'),
helpEntries: 'outlink',
helpEntries: ['outlink'],
placeholder: 'http://...',
inheritable: true,
},
@ -441,7 +441,7 @@ export const SCHEMA = {
max: 10,
step: 0.5,
label: translate('Simplify'),
helpEntries: 'smoothFactor',
helpEntries: ['smoothFactor'],
inheritable: true,
default: 1.0,
},
@ -459,7 +459,7 @@ export const SCHEMA = {
type: Boolean,
impacts: ['data'],
label: translate('stroke'),
helpEntries: 'stroke',
helpEntries: ['stroke'],
inheritable: true,
default: true,
},
@ -467,7 +467,7 @@ export const SCHEMA = {
type: Boolean,
impacts: ['sync', 'ui'],
label: translate('Enable real-time collaboration'),
helpEntries: 'sync',
helpEntries: ['sync'],
default: false,
},
tilelayer: {
@ -526,7 +526,7 @@ export const SCHEMA = {
type: Number,
impacts: [], // not need to update the view
placeholder: translate('Inherit'),
helpEntries: 'zoomTo',
helpEntries: ['zoomTo'],
label: translate('Default zoom level'),
inheritable: true,
},