function updateNodeProperties(node, outputMap) {
        node.resize = true;
        node.dirty = true;
        var removedLinks = [];
        if (node.ports) {
            if (outputMap) {
                RED.nodes.eachLink(function(l) {
                    if (l.source === node && outputMap.hasOwnProperty(l.sourcePort)) {
                        if (outputMap[l.sourcePort] === "-1") {
                            removedLinks.push(l);
                        } else {
                            l.sourcePort = outputMap[l.sourcePort];
                        }
                    }
                });
            }
            if (node.outputs < node.ports.length) {
                while (node.outputs < node.ports.length) {
                    node.ports.pop();
                }
                RED.nodes.eachLink(function(l) {
                    if (l.source === node && l.sourcePort >= node.outputs && removedLinks.indexOf(l) === -1) {
                        removedLinks.push(l);
                    }
                });
            } else if (node.outputs > node.ports.length) {
                while (node.outputs > node.ports.length) {
                    node.ports.push(node.ports.length);
                }
            }
        }
        if (node.inputs === 0) {
            removedLinks.concat(RED.nodes.filterLinks({target:node}));
        }
        for (var l=0;l<removedLinks.length;l++) {
            RED.nodes.removeLink(removedLinks[l]);
        }
        return removedLinks;
    }
/**
     * Called when the node's properties have changed.
     * Marks the node as dirty and needing a size check.
     * Removes any links to non-existant outputs.
     * @param node - the node that has been updated
     * @param outputMap - (optional) a map of old->new port numbers if wires should be moved
     * @returns {array} the links that were removed due to this update
     */
Called when the node's properties have changed.
Marks the node as dirty and needing a size check.
Removes any links to non-existant outputs.
@param node - the node that has been updated
@param outputMap - (optional) a map of old->new port numbers if wires should be moved
@returns {array} the links that were removed due to this update
Called when the node ' s properties have changed . Marks the node as dirty and needing a size check . Removes any links to non - existant outputs . @param node - the node that has been updated @param outputMap - ( optional ) a map of old - > new port numbers if wires should be moved @returns { array } the links that were removed due to this update
function updateNodeProperties(node, outputMap) {
        node.resize = true;
        node.dirty = true;
        var removedLinks = [];
        if (node.ports) {
            if (outputMap) {
                RED.nodes.eachLink(function(l) {
                    if (l.source === node && outputMap.hasOwnProperty(l.sourcePort)) {
                        if (outputMap[l.sourcePort] === "-1") {
                            removedLinks.push(l);
                        } else {
                            l.sourcePort = outputMap[l.sourcePort];
                        }
                    }
                });
            }
            if (node.outputs < node.ports.length) {
                while (node.outputs < node.ports.length) {
                    node.ports.pop();
                }
                RED.nodes.eachLink(function(l) {
                    if (l.source === node && l.sourcePort >= node.outputs && removedLinks.indexOf(l) === -1) {
                        removedLinks.push(l);
                    }
                });
            } else if (node.outputs > node.ports.length) {
                while (node.outputs > node.ports.length) {
                    node.ports.push(node.ports.length);
                }
            }
        }
        if (node.inputs === 0) {
            removedLinks.concat(RED.nodes.filterLinks({target:node}));
        }
        for (var l=0;l<removedLinks.length;l++) {
            RED.nodes.removeLink(removedLinks[l]);
        }
        return removedLinks;
    }
function updateNodeProperties ( node , outputMap ) { node . resize = true ; node . dirty = true ; var removedLinks = [ ] ; if ( node . ports ) { if ( outputMap ) { RED . nodes . eachLink ( function ( l ) { if ( l . source === node && outputMap . hasOwnProperty ( l . sourcePort ) ) { if ( outputMap [ l . sourcePort ] === "-1" ) { removedLinks . push ( l ) ; } else { l . sourcePort = outputMap [ l . sourcePort ] ; } } } ) ; } if ( node . outputs < node . ports . length ) { while ( node . outputs < node . ports . length ) { node . ports . pop ( ) ; } RED . nodes . eachLink ( function ( l ) { if ( l . source === node && l . sourcePort >= node . outputs && removedLinks . indexOf ( l ) === - 1 ) { removedLinks . push ( l ) ; } } ) ; } else if ( node . outputs > node . ports . length ) { while ( node . outputs > node . ports . length ) { node . ports . push ( node . ports . length ) ; } } } if ( node . inputs === 0 ) { removedLinks . concat ( RED . nodes . filterLinks ( { target : node } ) ) ; } for ( var l = 0 ; l < removedLinks . length ; l ++ ) { RED . nodes . removeLink ( removedLinks [ l ] ) ; } return removedLinks ; }
Called when the node's properties have changed.
Called when the node ' s properties have changed .