From 7873f0c425fe9a9175fb9f01d4dbaf29cb4d1678 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 29 Mar 2017 12:35:33 -0400 Subject: [PATCH] Relax rules for using keyboard shortcuts in the walkthrough --- modules/behavior/copy.js | 1 - modules/behavior/operation.js | 2 +- modules/behavior/paste.js | 1 - modules/ui/init.js | 4 +--- modules/ui/undo_redo.js | 4 ++-- modules/ui/zoom.js | 8 ++++---- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/modules/behavior/copy.js b/modules/behavior/copy.js index 5f79f1a7e..8535f6d77 100644 --- a/modules/behavior/copy.js +++ b/modules/behavior/copy.js @@ -42,7 +42,6 @@ export function behaviorCopy(context) { function doCopy() { d3.event.preventDefault(); - if (context.inIntro()) return; var graph = context.graph(), selected = groupEntities(context.selectedIDs(), graph), diff --git a/modules/behavior/operation.js b/modules/behavior/operation.js index 3c224656b..e1bef5733 100644 --- a/modules/behavior/operation.js +++ b/modules/behavior/operation.js @@ -33,7 +33,7 @@ export function behaviorOperation(context) { var behavior = function () { - if (which && which.available() && !context.inIntro()) { + if (which && which.available()) { keybinding = d3keybinding('behavior.key.' + which.id); keybinding.on(which.keys, function() { d3.event.preventDefault(); diff --git a/modules/behavior/paste.js b/modules/behavior/paste.js index b1ebe3970..f472e14cb 100644 --- a/modules/behavior/paste.js +++ b/modules/behavior/paste.js @@ -39,7 +39,6 @@ export function behaviorPaste(context) { function doPaste() { d3.event.preventDefault(); - if (context.inIntro()) return; var baseGraph = context.graph(), mouse = context.mouse(), diff --git a/modules/ui/init.js b/modules/ui/init.js index 324e01ad7..ec38b78bf 100644 --- a/modules/ui/init.js +++ b/modules/ui/init.js @@ -255,9 +255,7 @@ export function uiInit(context) { function pan(d) { return function() { d3.event.preventDefault(); - if (!context.inIntro()) { - context.pan(d, 100); - } + context.pan(d, 100); }; } diff --git a/modules/ui/undo_redo.js b/modules/ui/undo_redo.js index c0f4cdf8a..54ee8742c 100644 --- a/modules/ui/undo_redo.js +++ b/modules/ui/undo_redo.js @@ -11,12 +11,12 @@ export function uiUndoRedo(context) { var commands = [{ id: 'undo', cmd: uiCmd('⌘Z'), - action: function() { if (!(context.inIntro() || saving())) context.undo(); }, + action: function() { if (!saving()) context.undo(); }, annotation: function() { return context.history().undoAnnotation(); } }, { id: 'redo', cmd: uiCmd('⌘⇧Z'), - action: function() {if (!(context.inIntro() || saving())) context.redo(); }, + action: function() { if (!saving()) context.redo(); }, annotation: function() { return context.history().redoAnnotation(); } }]; diff --git a/modules/ui/zoom.js b/modules/ui/zoom.js index e8065d581..28e00d22b 100644 --- a/modules/ui/zoom.js +++ b/modules/ui/zoom.js @@ -26,25 +26,25 @@ export function uiZoom(context) { function zoomIn() { d3.event.preventDefault(); - if (!context.inIntro()) context.zoomIn(); + context.zoomIn(); } function zoomOut() { d3.event.preventDefault(); - if (!context.inIntro()) context.zoomOut(); + context.zoomOut(); } function zoomInFurther() { d3.event.preventDefault(); - if (!context.inIntro()) context.zoomInFurther(); + context.zoomInFurther(); } function zoomOutFurther() { d3.event.preventDefault(); - if (!context.inIntro()) context.zoomOutFurther(); + context.zoomOutFurther(); }