mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-04 22:18:06 +02:00
Use context.keybinding for keybindings that don't change
(closes #5487)
This commit is contained in:
@@ -159,7 +159,8 @@ export function modeMove(context, entityIDs, baseGraph) {
|
||||
context.history()
|
||||
.on('undone.move', null);
|
||||
|
||||
keybinding.off();
|
||||
d3_select(document)
|
||||
.call(keybinding.unbind);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -142,7 +142,8 @@ export function modeRotate(context, entityIDs) {
|
||||
context.history()
|
||||
.on('undone.rotate', null);
|
||||
|
||||
keybinding.off();
|
||||
d3_select(document)
|
||||
.call(keybinding.unbind);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ export function modeSave(context) {
|
||||
|
||||
function keybindingOff() {
|
||||
d3_select(document)
|
||||
.call(keybinding.off);
|
||||
.call(keybinding.unbind);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -511,7 +511,10 @@ export function modeSelect(context, selectedIDs) {
|
||||
if (inspector) wrap.call(inspector.close);
|
||||
|
||||
behaviors.forEach(context.uninstall);
|
||||
keybinding.off();
|
||||
|
||||
d3_select(document)
|
||||
.call(keybinding.unbind);
|
||||
|
||||
closeMenu();
|
||||
editMenu = undefined;
|
||||
|
||||
|
||||
@@ -63,7 +63,9 @@ export function modeSelectData(context, selectedDatum) {
|
||||
mode.enter = function() {
|
||||
behaviors.forEach(context.install);
|
||||
keybinding.on('⎋', esc, true);
|
||||
d3_select(document).call(keybinding);
|
||||
|
||||
d3_select(document)
|
||||
.call(keybinding);
|
||||
|
||||
selectData();
|
||||
|
||||
@@ -81,7 +83,9 @@ export function modeSelectData(context, selectedDatum) {
|
||||
|
||||
mode.exit = function() {
|
||||
behaviors.forEach(context.uninstall);
|
||||
keybinding.off();
|
||||
|
||||
d3_select(document)
|
||||
.call(keybinding.unbind);
|
||||
|
||||
context.surface()
|
||||
.selectAll('.layer-mapdata .selected')
|
||||
|
||||
@@ -95,7 +95,9 @@ export function modeSelectNote(context, selectedNoteID) {
|
||||
|
||||
behaviors.forEach(context.install);
|
||||
keybinding.on('⎋', esc, true);
|
||||
d3_select(document).call(keybinding);
|
||||
|
||||
d3_select(document)
|
||||
.call(keybinding);
|
||||
|
||||
selectNote();
|
||||
|
||||
@@ -112,7 +114,9 @@ export function modeSelectNote(context, selectedNoteID) {
|
||||
|
||||
mode.exit = function() {
|
||||
behaviors.forEach(context.uninstall);
|
||||
keybinding.off();
|
||||
|
||||
d3_select(document)
|
||||
.call(keybinding.unbind);
|
||||
|
||||
context.surface()
|
||||
.selectAll('.layer-notes .selected')
|
||||
|
||||
Reference in New Issue
Block a user