Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ qx.Class.define("osparc.navigation.NavigationBar", {
}
case "tasks-button":
control = new osparc.task.TasksButton().set({
visibility: "excluded",
...this.self().RIGHT_BUTTON_OPTS
});
this.getChildControl("right-items").add(control);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ qx.Class.define("osparc.task.TasksButton", {
});

const tasks = osparc.task.TasksContainer.getInstance();
tasks.getTasks().addListener("change", e => this.__updateTasksButton(), this);
tasks.getTasks().addListener("change", () => this.__updateTasksButton(), this);
this.__updateTasksButton();
this.addListener("tap", () => this.__showTasks(), this);
},

Expand Down Expand Up @@ -60,8 +61,8 @@ qx.Class.define("osparc.task.TasksButton", {
"border-radius": "8px"
});
this._add(control, {
bottom: 8,
right: 4
bottom: -6,
right: -4
});
break;
}
Expand All @@ -74,7 +75,11 @@ qx.Class.define("osparc.task.TasksButton", {

const tasks = osparc.task.TasksContainer.getInstance();
const nTasks = tasks.getTasks().length;
number.setValue(nTasks.toString());
if (nTasks > 9) {
number.setValue("9+");
} else {
number.setValue(nTasks.toString());
}
nTasks ? this.show() : this.exclude();
},

Expand Down
Loading