Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
is linkingTool connected to draggingTool in go.js?

I am trying to add functionality to a go.js diagram such that, you can only create links when the shift key is pressed. I can do that fine. But as a consequence, I don't want the user to be able to move the node when the shift key is pressed.

To achieve part 1, I overrode linkingTool.canStart. This achieved that goal admerably.

To achieve part 2, I overrode draggingTool.canStart. This stops the ability to drag nodes but breaks part 1 with an Uncaught TypeError: this.findLinkablePort is not a function.

tool = myDiagram.toolManager.linkingTool
  tool.canStart = function(){
    return event.shiftKey && go.LinkingTool.prototype.canStart.call(tool)
  }

tool = myDiagram.toolManager.draggingTool
  tool.canStart = function(){
    return !event.shiftKey && go.DraggingTool.prototype.canStart.call(tool)
  }

My assumption is that linkingTool uses draggingTool somehow, but I cant find that in the API and I don't know what I can do to fix it. Any ideas as to what is going on?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can't depend on event in event.shiftKey. Instead use this.diagram.lastInput.shift.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda