add keyboard shortcut for opening route loader dialog
The route loader can be opened by pressing key 'r' now.
This commit is contained in:
parent
f7ef9de8ef
commit
dcc5d3a554
1 changed files with 15 additions and 0 deletions
|
|
@ -15,6 +15,9 @@ BR.routeLoader = function (map, layersControl, routing, pois) {
|
||||||
simplifyTolerance: -1,
|
simplifyTolerance: -1,
|
||||||
isTestMode: false,
|
isTestMode: false,
|
||||||
simplifyLastKnownGood: 0.001,
|
simplifyLastKnownGood: 0.001,
|
||||||
|
shortcut: {
|
||||||
|
open: 82, // char code for 'r'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
setDialogDraggable: function (jqDlgHeader) {
|
setDialogDraggable: function (jqDlgHeader) {
|
||||||
|
|
@ -90,6 +93,9 @@ BR.routeLoader = function (map, layersControl, routing, pois) {
|
||||||
simplifyTolerance: -1,
|
simplifyTolerance: -1,
|
||||||
isTestMode: false,
|
isTestMode: false,
|
||||||
simplifyLastKnownGood: 0.001,
|
simplifyLastKnownGood: 0.001,
|
||||||
|
shortcut: {
|
||||||
|
open: 82, // char code for 'r'
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -224,6 +230,8 @@ BR.routeLoader = function (map, layersControl, routing, pois) {
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
L.DomEvent.addListener(document, 'keydown', this.keydownListener, this);
|
||||||
|
|
||||||
// dummy, no own representation, delegating to EasyButton
|
// dummy, no own representation, delegating to EasyButton
|
||||||
var dummy = L.DomUtil.create('div');
|
var dummy = L.DomUtil.create('div');
|
||||||
dummy.hidden = true;
|
dummy.hidden = true;
|
||||||
|
|
@ -382,6 +390,13 @@ BR.routeLoader = function (map, layersControl, routing, pois) {
|
||||||
|
|
||||||
this.onBusyChanged(false);
|
this.onBusyChanged(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
keydownListener: function (e) {
|
||||||
|
if (BR.Util.keyboardShortcutsAllowed(e) && e.keyCode === this._options.shortcut.open) {
|
||||||
|
$('#navbarLoadEditTracks').click();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
RouteLoader.include(L.Evented.prototype);
|
RouteLoader.include(L.Evented.prototype);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue