1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix jshint errors

This commit is contained in:
Nick O'Leary 2015-08-13 22:18:47 +01:00
parent 3a6192bf73
commit 00c612485b
3 changed files with 7 additions and 5 deletions

View File

@ -33,6 +33,7 @@ RED.history = (function() {
var ev = undo_history.pop(); var ev = undo_history.pop();
var i; var i;
var node; var node;
var subflow;
var modifiedTabs = {}; var modifiedTabs = {};
if (ev) { if (ev) {
if (ev.t == 'add') { if (ev.t == 'add') {
@ -73,7 +74,7 @@ RED.history = (function() {
}); });
} }
if (ev.subflow.hasOwnProperty('changed')) { if (ev.subflow.hasOwnProperty('changed')) {
var subflow = RED.nodes.subflow(ev.subflow.id); subflow = RED.nodes.subflow(ev.subflow.id);
if (subflow) { if (subflow) {
subflow.changed = ev.subflow.changed; subflow.changed = ev.subflow.changed;
} }
@ -89,7 +90,6 @@ RED.history = (function() {
if (ev.subflow && ev.subflow.subflow) { if (ev.subflow && ev.subflow.subflow) {
RED.nodes.addSubflow(ev.subflow.subflow); RED.nodes.addSubflow(ev.subflow.subflow);
} }
var subflow;
if (ev.subflowInputs && ev.subflowInputs.length > 0) { if (ev.subflowInputs && ev.subflowInputs.length > 0) {
subflow = RED.nodes.subflow(ev.subflowInputs[0].z); subflow = RED.nodes.subflow(ev.subflowInputs[0].z);
subflow.in.push(ev.subflowInputs[0]); subflow.in.push(ev.subflowInputs[0]);

View File

@ -271,8 +271,9 @@ RED.editor = (function() {
RED.nodes.dirty(true); RED.nodes.dirty(true);
var activeSubflow = RED.nodes.subflow(RED.workspaces.active()); var activeSubflow = RED.nodes.subflow(RED.workspaces.active());
var subflowInstances = null;
if (activeSubflow) { if (activeSubflow) {
var subflowInstances = []; subflowInstances = [];
RED.nodes.eachNode(function(n) { RED.nodes.eachNode(function(n) {
if (n.type == "subflow:"+RED.workspaces.active()) { if (n.type == "subflow:"+RED.workspaces.active()) {
subflowInstances.push({ subflowInstances.push({

View File

@ -754,6 +754,7 @@ RED.view = (function() {
redraw(); redraw();
} }
function deleteSelection() { function deleteSelection() {
var result;
var removedNodes = []; var removedNodes = [];
var removedLinks = []; var removedLinks = [];
var removedSubflowOutputs = []; var removedSubflowOutputs = [];
@ -784,14 +785,14 @@ RED.view = (function() {
} }
} }
if (removedSubflowOutputs.length > 0) { if (removedSubflowOutputs.length > 0) {
var result = RED.subflow.removeOutput(removedSubflowOutputs); result = RED.subflow.removeOutput(removedSubflowOutputs);
if (result) { if (result) {
removedLinks = removedLinks.concat(result.links); removedLinks = removedLinks.concat(result.links);
} }
} }
// Assume 0/1 inputs // Assume 0/1 inputs
if (removedSubflowInputs.length == 1) { if (removedSubflowInputs.length == 1) {
var result = RED.subflow.removeInput(); result = RED.subflow.removeInput();
if (result) { if (result) {
removedLinks = removedLinks.concat(result.links); removedLinks = removedLinks.concat(result.links);
} }