Merge pull request #507 from legendtang/fix_flowactions

fix #506
This commit is contained in:
Maximilian Hils 2015-03-06 10:00:50 +01:00
commit 8c1978b7bf
3 changed files with 23 additions and 19 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,7 @@ var Filt = require("../filt/filt.js");
var utils = require("../utils.js");
var common = require("./common.js");
var actions = require("../actions.js");
var FilterDocs = React.createClass({
statics: {
@ -275,7 +276,7 @@ var FileMenu = React.createClass({
handleNewClick: function (e) {
e.preventDefault();
if (confirm("Delete all flows?")) {
FlowActions.clear();
actions.FlowActions.clear();
}
},
handleOpenClick: function (e) {

View File

@ -1,6 +1,7 @@
var React = require("react");
var common = require("./common.js");
var actions = require("../actions.js");
var toputils = require("../utils.js");
var views = require("../store/view.js");
var Filt = require("../filt/filt.js");
@ -166,33 +167,33 @@ var MainView = React.createClass({
break;
case toputils.Key.C:
if (e.shiftKey) {
FlowActions.clear();
actions.FlowActions.clear();
}
break;
case toputils.Key.D:
if (flow) {
if (e.shiftKey) {
FlowActions.duplicate(flow);
actions.FlowActions.duplicate(flow);
} else {
FlowActions.delete(flow);
actions.FlowActions.delete(flow);
}
}
break;
case toputils.Key.A:
if (e.shiftKey) {
FlowActions.accept_all();
actions.FlowActions.accept_all();
} else if (flow && flow.intercepted) {
FlowActions.accept(flow);
actions.FlowActions.accept(flow);
}
break;
case toputils.Key.R:
if (!e.shiftKey && flow) {
FlowActions.replay(flow);
actions.FlowActions.replay(flow);
}
break;
case toputils.Key.V:
if(e.shiftKey && flow && flow.modified) {
FlowActions.revert(flow);
actions.FlowActions.revert(flow);
}
break;
default: