Skip to content

Commit 589e9aa

Browse files
committed
multi action
1 parent c6dcd3b commit 589e9aa

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

services/static-webserver/client/source/class/osparc/file/FileLabelWithActions.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
132132
this.__multiSelection = multiSelectionData;
133133
if (multiSelectionData && multiSelectionData.length) {
134134
if (multiSelectionData.length === 1) {
135-
this.setItemSelected(multiSelectionData[0].entry);
135+
this.setItemSelected(multiSelectionData[0]);
136136
} else {
137137
const selectedLabel = this.getChildControl("selected-label");
138138
selectedLabel.set({
@@ -161,18 +161,29 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
161161
},
162162

163163
__retrieveURLAndDownloadSelected: function() {
164-
let selection = this.getItemSelected();
165-
if (selection) {
166-
this.__retrieveURLAndDownloadFile(selection);
164+
if (this.isMultiSelect()) {
165+
this.__multiSelection.forEach(selection => {
166+
this.__retrieveURLAndDownloadFile(selection);
167+
});
168+
} else {
169+
const selection = this.getItemSelected();
170+
if (selection) {
171+
this.__retrieveURLAndDownloadFile(selection);
172+
}
167173
}
168174
},
169175

170176
__deleteSelected: function() {
171-
const selection = this.getItemSelected();
172-
if (selection) {
173-
return this.__deleteFile(selection);
177+
if (this.isMultiSelect()) {
178+
this.__multiSelection.forEach(selection => {
179+
this.__deleteFile(selection);
180+
});
181+
} else {
182+
const selection = this.getItemSelected();
183+
if (selection) {
184+
this.__deleteFile(selection);
185+
}
174186
}
175-
return false;
176187
},
177188

178189
__retrieveURLAndDownloadFile: function(file) {

services/static-webserver/client/source/class/osparc/file/FolderContent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ qx.Class.define("osparc.file.FolderContent", {
262262
const iconsLayout = this.getChildControl("icons-layout");
263263
iconsLayout.getChildren().forEach(btn => {
264264
if (osparc.file.FilesTree.isFile(btn.entry) && btn.getValue()) {
265-
selectedFiles.push(btn);
265+
selectedFiles.push(btn.entry);
266266
}
267267
});
268268
this.__itemTapped(selectedFiles, gridItem.getValue());

0 commit comments

Comments
 (0)