Skip to content

Commit b8c461e

Browse files
committed
getGuidedToursButton
1 parent 414fe6e commit b8c461e

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

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

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,21 @@ qx.Class.define("osparc.store.Support", {
8787
return null;
8888
},
8989

90-
addGuidedToursToMenu: function(menu) {
91-
const guidedToursButton = new qx.ui.menu.Button(qx.locale.Manager.tr("Guided Tours"), "@FontAwesome5Solid/graduation-cap/14");
92-
guidedToursButton.exclude();
93-
menu.add(guidedToursButton);
90+
__getGuidedToursInfo: function() {
91+
return {
92+
label: qx.locale.Manager.tr("Guided Tours"),
93+
icon: "@FontAwesome5Solid/graduation-cap/14",
94+
}
95+
},
96+
97+
populateGuidedToursButton: function(button) {
9498
const fetchTours = osparc.product.tours.Tours.getTours();
9599
if (fetchTours) {
96100
fetchTours
97101
.then(tours => {
98102
if (tours) {
99-
guidedToursButton.show();
100-
guidedToursButton.addListener("execute", () => {
103+
button.show();
104+
button.addListener("execute", () => {
101105
const toursManager = new osparc.tours.Manager();
102106
toursManager.setTours(tours);
103107
toursManager.start();
@@ -107,6 +111,22 @@ qx.Class.define("osparc.store.Support", {
107111
}
108112
},
109113

114+
addGuidedToursToMenu: function(menu) {
115+
const guidedToursInfo = this.__getGuidedToursInfo();
116+
const guidedToursButton = new qx.ui.menu.Button(guidedToursInfo.label, guidedToursInfo.icon);
117+
guidedToursButton.exclude();
118+
menu.add(guidedToursButton);
119+
this.populateGuidedToursButton(guidedToursButton);
120+
},
121+
122+
getGuidedToursButton: function() {
123+
const guidedToursInfo = this.__getGuidedToursInfo();
124+
const guidedToursButton = new qx.ui.form.Button(guidedToursInfo.label, guidedToursInfo.icon);
125+
guidedToursButton.exclude();
126+
this.populateGuidedToursButton(guidedToursButton);
127+
return guidedToursButton;
128+
},
129+
110130
addManualsToMenu: function(menu) {
111131
const manuals = osparc.store.Support.getManuals();
112132
const addManuals = mn => {

services/static-webserver/client/source/class/osparc/support/HomePage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ qx.Class.define("osparc.support.HomePage", {
5656
if (quickStartButton) {
5757
this._add(quickStartButton);
5858
}
59+
60+
const guidedToursButton = osparc.store.Support.getGuidedToursButton();
61+
this._add(guidedToursButton);
5962
},
6063
}
6164
});

0 commit comments

Comments
 (0)