@@ -191,19 +191,24 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
191191    __addHypertools : function ( )  { 
192192      const  hypertools  =  osparc . store . Templates . getInstance ( ) . getTemplatesByType ( osparc . data . model . StudyUI . HYPERTOOL_TYPE ) ; 
193193      if  ( hypertools . length )  { 
194-         const  moreMenuButton  =  this . self ( ) . createMenuButton ( "@FontAwesome5Solid/star/16" ,  this . tr ( "Hypertools" ) ) ; 
195-         this . addAt ( moreMenuButton ,  this . __itemIdx ) ; 
194+         const  hypertoolsMenuButton  =  this . self ( ) . createMenuButton ( "@FontAwesome5Solid/star/16" ,  this . tr ( "Hypertools" ) ) ; 
195+         this . addAt ( hypertoolsMenuButton ,  this . __itemIdx ) ; 
196196        this . __itemIdx ++ ; 
197197
198-         const  moreMenu  =  new  qx . ui . menu . Menu ( ) . set ( { 
198+         const  hypertoolsMenu  =  new  qx . ui . menu . Menu ( ) . set ( { 
199199          appearance : "menu-wider" , 
200200        } ) ; 
201+         hypertoolsMenuButton . setMenu ( hypertoolsMenu ) ; 
202+ 
201203        hypertools . forEach ( templateData  =>  { 
202204          const  hypertoolButton  =  this . self ( ) . createMenuButton ( templateData [ "icon" ] ,  templateData [ "name" ] ) ; 
203-           hypertoolButton . addListener ( "execute" ,  ( )  =>  { 
204-             console . log ( templateData ) ; 
205-           } ,  this ) ; 
206-           moreMenu . add ( hypertoolButton ) ; 
205+           hypertoolButton . addListener ( "tap" ,  ( )  =>  { 
206+             this . fireDataEvent ( "newStudyFromTemplateClicked" ,  { 
207+               templateData, 
208+               newStudyLabel : templateData [ "name" ] , 
209+             } ) ; 
210+           } ) ; 
211+           hypertoolsMenu . add ( hypertoolButton ) ; 
207212        } ) ; 
208213      } 
209214    } , 
@@ -216,6 +221,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
216221      const  moreMenu  =  new  qx . ui . menu . Menu ( ) . set ( { 
217222        appearance : "menu-wider" , 
218223      } ) ; 
224+       moreMenuButton . setMenu ( moreMenu ) ; 
219225
220226      const  permissions  =  osparc . data . Permissions . getInstance ( ) ; 
221227      if  ( permissions . canDo ( "dashboard.templates.read" ) )  { 
@@ -229,10 +235,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
229235        servicesButton . addListener ( "execute" ,  ( )  =>  this . fireDataEvent ( "changeTab" ,  "servicesTab" ) ,  this ) ; 
230236        moreMenu . add ( servicesButton ) ; 
231237      } 
232- 
233238      moreMenuButton . setVisibility ( moreMenu . getChildren ( ) . length  ? "visible"  : "excluded" ) ; 
234- 
235-       moreMenuButton . setMenu ( moreMenu ) ; 
236239    } , 
237240
238241    __getLastIdxFromCategory : function ( categoryId )  { 
0 commit comments