From 300616819d7d42bd8d12dfd334f9ec85d0cd3283 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 24 Jan 2018 13:46:01 -0500 Subject: [PATCH] Don't use the same keybind id for modeSave (esc dialog) and uiSave (Ctrl+S) (closes #4728) --- modules/modes/save.js | 2 +- modules/ui/save.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/modes/save.js b/modules/modes/save.js index f5198b41b..d8f14addb 100644 --- a/modules/modes/save.js +++ b/modules/modes/save.js @@ -47,7 +47,7 @@ var _isSaving = false; export function modeSave(context) { var mode = { id: 'save' }; - var keybinding = d3_keybinding('save'); + var keybinding = d3_keybinding('modeSave'); var loading = uiLoading(context) .message(t('save.uploading')) diff --git a/modules/ui/save.js b/modules/ui/save.js index de7f9dd40..0cb807195 100644 --- a/modules/ui/save.js +++ b/modules/ui/save.js @@ -16,12 +16,13 @@ import { tooltip } from '../util/tooltip'; export function uiSave(context) { - var history = context.history(), - key = uiCmd('⌘S'); + var history = context.history(); + var key = uiCmd('⌘S'); function saving() { - return context.mode().id === 'save'; + var mode = context.mode(); + return mode && mode.id === 'save'; } @@ -100,7 +101,7 @@ export function uiSave(context) { updateCount(); - var keybinding = d3_keybinding('save') + var keybinding = d3_keybinding('uiSave') .on(key, save, true); d3_select(document)