Skip to content

Commit

Permalink
multi action
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Dec 12, 2024
1 parent c6dcd3b commit 589e9aa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
this.__multiSelection = multiSelectionData;
if (multiSelectionData && multiSelectionData.length) {
if (multiSelectionData.length === 1) {
this.setItemSelected(multiSelectionData[0].entry);
this.setItemSelected(multiSelectionData[0]);
} else {
const selectedLabel = this.getChildControl("selected-label");
selectedLabel.set({
Expand Down Expand Up @@ -161,18 +161,29 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
},

__retrieveURLAndDownloadSelected: function() {
let selection = this.getItemSelected();
if (selection) {
this.__retrieveURLAndDownloadFile(selection);
if (this.isMultiSelect()) {
this.__multiSelection.forEach(selection => {
this.__retrieveURLAndDownloadFile(selection);
});
} else {
const selection = this.getItemSelected();
if (selection) {
this.__retrieveURLAndDownloadFile(selection);
}
}
},

__deleteSelected: function() {
const selection = this.getItemSelected();
if (selection) {
return this.__deleteFile(selection);
if (this.isMultiSelect()) {
this.__multiSelection.forEach(selection => {
this.__deleteFile(selection);
});
} else {
const selection = this.getItemSelected();
if (selection) {
this.__deleteFile(selection);
}
}
return false;
},

__retrieveURLAndDownloadFile: function(file) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ qx.Class.define("osparc.file.FolderContent", {
const iconsLayout = this.getChildControl("icons-layout");
iconsLayout.getChildren().forEach(btn => {
if (osparc.file.FilesTree.isFile(btn.entry) && btn.getValue()) {
selectedFiles.push(btn);
selectedFiles.push(btn.entry);
}
});
this.__itemTapped(selectedFiles, gridItem.getValue());
Expand Down

0 comments on commit 589e9aa

Please sign in to comment.