Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7420

Clash of mouseOver, mouseLeave, clickand doubleClick events

$
0
0

@anguskwalker wrote:

I have a highlighting function, that i call on mouseOver, then an action I wish to execute if they click (or maybe double click) the item, however, although the click and mouse events work if i comment out either of the other ones.

If I include all the following code, the mouseOver action is constantly running (i see it actioning in firefox) and prevents the doubleClick from actioning. Also the context menu is frozen out if I include the mouseOver actions. Do you have any idea of a solution for this.

myDiagram.nodeTemplate =
  $(go.Node, "Auto",
    new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
 	{
        //click: function(e, obj) {
        //	alert(obj.part.data.key);
        //},
        mouseOver: function(e, obj) {
            highlightDependancies(obj.part.data.key);
        },
        mouseLeave: function(e, obj) {
            restoreDiagram(e, obj);
        },
        doubleClick: function(e, obj) {
            load_content(obj.part.data.url);
        }
    },      
    $(go.Shape, "Rectangle",
      { fill: "white", portId: "", cursor: "pointer", fromLinkable: true, toLinkable: true },
      new go.Binding("fill", "bgcolor")),
    $(go.TextBlock, { margin: 5 },
      new go.Binding("text", "titletxt"),
      new go.Binding("stroke", "txcolor")),
    { dragComputation: stayInGroup }, // limit dragging of Nodes to stay within the containing Group, defined above
  {
    contextMenu:     // define a context menu for each node
      $(go.Adornment, "Vertical",  
        $("ContextMenuButton",
          $(go.TextBlock, "Show Dependancies"),
          { click: showDependancies }),
        $("ContextMenuButton",
          $(go.TextBlock, "Highlight Dependancies"),
          { click: highlightDependancies }),
        $("ContextMenuButton",
          $(go.TextBlock, "Restore Diagram"),
          { click: restoreDiagram })
      )  // end Adornment
  }

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7420

Trending Articles