forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
a81dbb170e
39 changed files with 464 additions and 134 deletions
|
@ -7,6 +7,7 @@ import { UIEventSource } from "../../Logic/UIEventSource"
|
|||
import { VariableUiElement } from "./VariableUIElement"
|
||||
import { Translation } from "../i18n/Translation"
|
||||
import { FixedUiElement } from "./FixedUiElement"
|
||||
import Translations from "../i18n/Translations"
|
||||
|
||||
export default class Hotkeys {
|
||||
private static readonly _docs: UIEventSource<
|
||||
|
@ -106,11 +107,12 @@ export default class Hotkeys {
|
|||
return <[string, string | Translation]>[modifiers.join("+"), documentation]
|
||||
})
|
||||
.sort()
|
||||
const t = Translations.t.hotkeyDocumentation
|
||||
return new Combine([
|
||||
new Title("Hotkeys", 1),
|
||||
"MapComplete supports the following keys:",
|
||||
new Title(t.title, 1),
|
||||
t.intro,
|
||||
new Table(
|
||||
["Key combination", "Action"],
|
||||
[t.key, t.action],
|
||||
byKey.map(([key, doc]) => {
|
||||
return [new FixedUiElement(key).SetClass("code"), doc]
|
||||
})
|
||||
|
|
|
@ -404,7 +404,7 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
|||
|
||||
if (this._options.lastClickLocation) {
|
||||
const lastClickLocation = this._options.lastClickLocation
|
||||
map.on("click", function (e: LeafletMouseEvent) {
|
||||
map.addEventListener("click", function (e: LeafletMouseEvent) {
|
||||
if (e.originalEvent["dismissed"]) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -340,6 +340,7 @@ export default class ShowDataLayerImplementation {
|
|||
const self = this
|
||||
|
||||
function activate(event: LeafletMouseEvent) {
|
||||
Utils.preventDefaultOnMouseEvent(event)
|
||||
if (infobox === undefined) {
|
||||
const tags =
|
||||
self.allElements?.getEventSourceById(key) ??
|
||||
|
@ -383,8 +384,9 @@ export default class ShowDataLayerImplementation {
|
|||
leafletLayer.on({
|
||||
dblclick: activate,
|
||||
contextmenu: activate,
|
||||
click: activate,
|
||||
// click: activate,
|
||||
})
|
||||
leafletLayer.addEventListener("click", activate)
|
||||
// Add the feature to the index to open the popup when needed
|
||||
this.leafletLayersPerId.set(key, {
|
||||
feature: feature,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue