Relax rules for using keyboard shortcuts in the walkthrough

This commit is contained in:
Bryan Housel
2017-03-29 12:35:33 -04:00
parent 063d5605ae
commit 7873f0c425
6 changed files with 8 additions and 12 deletions
-1
View File
@@ -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),
+1 -1
View File
@@ -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();
-1
View File
@@ -39,7 +39,6 @@ export function behaviorPaste(context) {
function doPaste() {
d3.event.preventDefault();
if (context.inIntro()) return;
var baseGraph = context.graph(),
mouse = context.mouse(),
+1 -3
View File
@@ -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);
};
}
+2 -2
View File
@@ -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(); }
}];
+4 -4
View File
@@ -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();
}