Skip to content

Commit f34ccbf

Browse files
committed
if there are more than 1 manuals, add them in their own menu
1 parent 8761e79 commit f34ccbf

File tree

1 file changed

+21
-8
lines changed
  • services/static-webserver/client/source/class/osparc/store

1 file changed

+21
-8
lines changed

services/static-webserver/client/source/class/osparc/store/Support.js

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)