File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed
services/static-webserver/client/source/class/osparc/store Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -77,15 +77,28 @@ qx.Class.define("osparc.store.Support", {
7777
7878 addManualsToMenu : function ( menu ) {
7979 const manuals = osparc . store . Support . getManuals ( ) ;
80-
81- manuals . forEach ( manual => {
82- const manualBtn = new qx . ui . menu . Button ( manual . label , "@FontAwesome5Solid/book/14" ) ;
83- manualBtn . getChildControl ( "label" ) . set ( {
84- rich : true
80+ const addManuals = mn => {
81+ manuals . forEach ( manual => {
82+ const manualBtn = new qx . ui . menu . Button ( manual . label , "@FontAwesome5Solid/book/14" ) ;
83+ manualBtn . getChildControl ( "label" ) . set ( {
84+ rich : true
85+ } ) ;
86+ manualBtn . addListener ( "execute" , ( ) => window . open ( manual . url ) , this ) ;
87+ mn . add ( manualBtn ) ;
8588 } ) ;
86- manualBtn . addListener ( "execute" , ( ) => window . open ( manual . url ) , this ) ;
87- menu . add ( manualBtn ) ;
88- } ) ;
89+ } ;
90+ if ( manuals . length > 1 ) {
91+ // if there are more than 1 manuals, add them in their own menu
92+ const ownMenu = new qx . ui . menu . Menu ( ) . set ( {
93+ appearance : "menu-wider" ,
94+ } ) ;
95+ const manualsBtn = new qx . ui . menu . Button ( qx . locale . Manager . tr ( "Manuals" ) , "@FontAwesome5Solid/book/14" ) ;
96+ manualsBtn . setMenu ( ownMenu ) ;
97+ menu . add ( manualsBtn ) ;
98+ addManuals ( ownMenu ) ;
99+ } else {
100+ addManuals ( menu ) ;
101+ }
89102 } ,
90103
91104 addSupportButtonsToMenu : function ( menu , menuButton ) {
You can’t perform that action at this time.
0 commit comments