|
|
|
|
@ -330,9 +330,7 @@
|
|
|
|
|
this.multiSelectMenuItems[i] = this.multiSelectMenuItems[i](this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.fileMultiSelectMenu = new OCA.Files.FileMultiSelectMenu(this.multiSelectMenuItems);
|
|
|
|
|
this.fileMultiSelectMenu.render();
|
|
|
|
|
this.$el.find('.selectedActions').append(this.fileMultiSelectMenu.$el);
|
|
|
|
|
this._updateMultiSelectFileActions()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (options.sorting) {
|
|
|
|
|
@ -516,7 +514,7 @@
|
|
|
|
|
multiSelectMenuClick: function (ev, action) {
|
|
|
|
|
var actionFunction = _.find(this.multiSelectMenuItems, function (item) {return item.name === action;}).action;
|
|
|
|
|
if (actionFunction) {
|
|
|
|
|
actionFunction(ev);
|
|
|
|
|
actionFunction(this.getSelectedFiles());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
switch (action) {
|
|
|
|
|
@ -1368,6 +1366,32 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Register action for multiple selected files
|
|
|
|
|
*
|
|
|
|
|
* @param {OCA.Files.FileAction} fileAction object
|
|
|
|
|
* The callback of FileAction will be called with an array of files that are currently selected
|
|
|
|
|
*/
|
|
|
|
|
registerMultiSelectFileAction: function(fileAction) {
|
|
|
|
|
if (typeof this.multiSelectMenuItems === 'undefined') {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.multiSelectMenuItems.push(fileAction)
|
|
|
|
|
this._updateMultiSelectFileActions()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
_updateMultiSelectFileActions: function() {
|
|
|
|
|
if (typeof this.multiSelectMenuItems === 'undefined') {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.fileMultiSelectMenu = new OCA.Files.FileMultiSelectMenu(this.multiSelectMenuItems.sort(function(a, b) {
|
|
|
|
|
return a.order > b.order
|
|
|
|
|
}));
|
|
|
|
|
this.fileMultiSelectMenu.render();
|
|
|
|
|
this.$el.find('.selectedActions .filesSelectMenu').remove();
|
|
|
|
|
this.$el.find('.selectedActions').append(this.fileMultiSelectMenu.$el);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the files to be displayed in the list.
|
|
|
|
|
* This operation will re-render the list and update the summary.
|
|
|
|
|
@ -3785,6 +3809,7 @@
|
|
|
|
|
return t('files', 'Select file range');
|
|
|
|
|
},
|
|
|
|
|
iconClass: 'icon-fullscreen',
|
|
|
|
|
order: 15,
|
|
|
|
|
action: function() {
|
|
|
|
|
fileList._onClickToggleSelectionMode();
|
|
|
|
|
},
|
|
|
|
|
|