Use context.keybinding for keybindings that don't change

(closes #5487)
This commit is contained in:
Bryan Housel
2018-11-13 20:57:21 -05:00
parent bb30cbf555
commit 152022aec4
37 changed files with 252 additions and 319 deletions
+2 -1
View File
@@ -159,7 +159,8 @@ export function modeMove(context, entityIDs, baseGraph) {
context.history()
.on('undone.move', null);
keybinding.off();
d3_select(document)
.call(keybinding.unbind);
};
+2 -1
View File
@@ -142,7 +142,8 @@ export function modeRotate(context, entityIDs) {
context.history()
.on('undone.rotate', null);
keybinding.off();
d3_select(document)
.call(keybinding.unbind);
};
+1 -1
View File
@@ -487,7 +487,7 @@ export function modeSave(context) {
function keybindingOff() {
d3_select(document)
.call(keybinding.off);
.call(keybinding.unbind);
}
+4 -1
View File
@@ -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;
+6 -2
View File
@@ -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')
+6 -2
View File
@@ -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')