clientIO / joint

A proven SVG-based JavaScript diagramming library powering exceptional UIs
https://jointjs.com
Mozilla Public License 2.0
4.69k stars 852 forks source link

Uncaught TypeError: Cannot read property '_listenerId' of undefined #76

Closed pats closed 10 years ago

pats commented 10 years ago

Hello,

This issue exists in version joint.nojquery.js and joint.clean.js (with newest version of backbone, lodash.underscore etc.)

App code

var stages = $("tr[data-stage]").map(function() {
            return $(this).data("stage");
        }).get();

        var graph = new joint.dia.Graph;
        var paper = new joint.dia.Paper({
            el: $('#processStagesModal svg'),
            width: 2000,
            height: 2000,
            gridSize: 1,
            model: graph
        });

        var cells = [];

        stages.forEach(function(stage) {
            cells.push(new joint.shapes.basic.Rect({
                id: stage.id,
                size: {width: 80, height: 20},
                attrs: {
                    text: {text: stage.next, 'font-size': 12, 'font-family': 'monospace'},
                    rect: {
                        width: 80, height: 20,
                        rx: 5, ry: 5,
                        stroke: '#555'
                    }
                }
            }));

            stage.next.forEach(function(next) {
                cells.push(new joint.dia.Link({
                    source: {id: stage.id},
                    target: {id: next},
                    attrs: { '.marker-target': { d: 'M 4 0 L 0 2 L 4 4 z' } },
                    smooth: true
                }));
            });
        });

        graph.resetCells(cells);
        joint.layout.DirectedGraph.layout(graph, {setLinkVertices: false});

i use last version from master

Best regards, patS

DavidDurman commented 10 years ago

Duplicate of #79