Skip to content

Commit 43d81f1

Browse files
committed
populateMenu
1 parent f0edc20 commit 43d81f1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

services/static-webserver/client/source/class/osparc/dashboard/FolderButtonItem.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
9292
check: ["studiesAndFolders", "workspaces", "search", "trash"],
9393
nullable: false,
9494
init: "studiesAndFolders",
95-
event: "changeCurrentContext"
95+
event: "changeCurrentContext",
9696
},
9797
},
9898

@@ -153,8 +153,6 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
153153
folder.bind("parentFolderId", this, "parentFolderId");
154154
folder.bind("name", this, "title");
155155
folder.bind("lastModified", this, "lastModified");
156-
157-
this.__addMenuButton();
158156
},
159157

160158
__applyWorkspaceId: function(workspaceId) {
@@ -187,7 +185,7 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
187185
}
188186
},
189187

190-
__addMenuButton: function() {
188+
populateMenuButton: function() {
191189
const menuButton = this.getChildControl("menu-button");
192190
menuButton.setVisibility("visible");
193191

@@ -198,6 +196,7 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
198196
if (this.getCurrentContext() === "trash") {
199197
const trashButton = new qx.ui.menu.Button(this.tr("Restore"), "@MaterialIcons/restore_from_trash/16");
200198
trashButton.addListener("execute", () => this.fireDataEvent("untrashFolderRequested", this.getFolderId()), this);
199+
menu.add(trashButton);
201200

202201
menu.addSeparator();
203202

services/static-webserver/client/source/class/osparc/dashboard/ResourceContainerManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
424424
__createFolderCard: function(folder) {
425425
const card = new osparc.dashboard.FolderButtonItem(folder);
426426
this.bind("currentContext", card, "currentContext");
427+
card.populateMenuButton();
427428
[
428429
"folderSelected",
429430
"folderUpdated",

0 commit comments

Comments
 (0)