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)