chore: deactivate contextmenu and shortcuts in map preview

Contextmenu and keyboard shortcuts open controls, which are not
fully initiated when in mode `noControl`, which is the case for
preview.
This commit is contained in:
Yohan Boniface 2024-10-07 12:27:04 +02:00
parent 2ca6ffd5ca
commit e7ed14f216

View file

@ -191,15 +191,17 @@ U.Map = L.Map.extend({
this.renderEditToolbar()
}
if (!this.options.noControl) {
this.initShortcuts()
if (!this.options.noControl) this.initCaptionBar()
this.initCaptionBar()
this.on('contextmenu', this.onContextMenu)
this.onceDataLoaded(this.setViewFromQueryString)
this.on('click', this.closeInplaceToolbar)
this.propagate()
}
window.onbeforeunload = () => (this.editEnabled && this.isDirty) || null
this.backup()
this.on('click', this.closeInplaceToolbar)
this.on('contextmenu', this.onContextMenu)
this.propagate()
},
initSyncEngine: async function () {
@ -1752,7 +1754,7 @@ U.Map = L.Map.extend({
},
{
label: this.help.displayLabel('SEARCH'),
action: () => this.search(event),
action: () => this.search(),
}
)
if (this.options.urls.routing) {