@@ -828,39 +828,44 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
828828 const edgeUI = new osparc . workbench . EdgeUI ( edge , edgeRepresentation ) ;
829829 this . __edgesUI . push ( edgeUI ) ;
830830
831- const hint = edgeUI . getHint ( ) ;
832- const that = this ;
831+ this . __decorateEdgeUI ( edgeUI ) ;
832+ }
833+ } ,
834+
835+ __decorateEdgeUI : function ( edgeUI ) {
836+ const hint = edgeUI . getHint ( ) ;
837+ const edgeRepresentation = edgeUI . getRepresentation ( ) ;
838+ const that = this ;
839+ [
840+ edgeRepresentation . widerCurve . node ,
841+ edgeRepresentation . node
842+ ] . forEach ( svgEl => {
843+ svgEl . addEventListener ( "click" , e => {
844+ // this is needed to get out of the context of svg
845+ that . __setSelectedItem ( edgeUI . getEdgeId ( ) ) ; // eslint-disable-line no-underscore-dangle
846+ e . stopPropagation ( ) ;
847+ } , this ) ;
848+
849+ const topOffset = 20 ;
833850 [
834- edgeRepresentation . widerCurve . node ,
835- edgeRepresentation . node
836- ] . forEach ( svgEl => {
837- svgEl . addEventListener ( "click" , e => {
838- // this is needed to get out of the context of svg
839- that . __setSelectedItem ( edgeUI . getEdgeId ( ) ) ; // eslint-disable-line no-underscore-dangle
840- e . stopPropagation ( ) ;
851+ "mouseover" ,
852+ "mousemove"
853+ ] . forEach ( ev => {
854+ svgEl . addEventListener ( ev , e => {
855+ const leftOffset = - ( parseInt ( hint . getHintBounds ( ) . width / 2 ) ) ;
856+ const properties = {
857+ top : e . clientY + topOffset ,
858+ left : e . clientX + leftOffset
859+ } ;
860+ hint . setLayoutProperties ( properties ) ;
861+ if ( hint . getText ( ) ) {
862+ hint . show ( ) ;
863+ }
841864 } , this ) ;
842-
843- const topOffset = 20 ;
844- [
845- "mouseover" ,
846- "mousemove"
847- ] . forEach ( ev => {
848- svgEl . addEventListener ( ev , e => {
849- const leftOffset = - ( parseInt ( hint . getHintBounds ( ) . width / 2 ) ) ;
850- const properties = {
851- top : e . clientY + topOffset ,
852- left : e . clientX + leftOffset
853- } ;
854- hint . setLayoutProperties ( properties ) ;
855- if ( hint . getText ( ) ) {
856- hint . show ( ) ;
857- }
858- } , this ) ;
859- } ) ;
860865 } ) ;
861- edgeUI . getRepresentation ( ) . widerCurve . node . addEventListener ( "mouseout" , ( ) => hint . exclude ( ) , this ) ;
862- this . __svgLayer . addListener ( "mouseout" , ( ) => hint . exclude ( ) , this ) ;
863- }
866+ } ) ;
867+ edgeRepresentation . widerCurve . node . addEventListener ( "mouseout" , ( ) => hint . exclude ( ) , this ) ;
868+ this . __svgLayer . addListener ( "mouseout" , ( ) => hint . exclude ( ) , this ) ;
864869 } ,
865870
866871 __updateAllEdges : function ( ) {
0 commit comments