mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Merge pull request #35474 from nextcloud/feature/rich-workspace-visibility
Update rich-workspace visibility
This commit is contained in:
commit
9f2495cc09
1 changed files with 17 additions and 6 deletions
|
|
@ -81,10 +81,18 @@
|
|||
if (action === 'upload') {
|
||||
OC.hideMenus();
|
||||
} else {
|
||||
event.preventDefault();
|
||||
this.$el.find('.menuitem.active').removeClass('active');
|
||||
$target.addClass('active');
|
||||
this._promptFileName($target);
|
||||
var actionItem = _.filter(this._menuItems, function(item) {
|
||||
return item.id === action
|
||||
}).pop();
|
||||
if (typeof actionItem.useInput === 'undefined' || actionItem.useInput === true) {
|
||||
event.preventDefault();
|
||||
this.$el.find('.menuitem.active').removeClass('active');
|
||||
$target.addClass('active');
|
||||
this._promptFileName($target);
|
||||
} else {
|
||||
actionItem.actionHandler();
|
||||
OC.hideMenus();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -198,8 +206,10 @@
|
|||
templateName: actionSpec.templateName,
|
||||
iconClass: actionSpec.iconClass,
|
||||
fileType: actionSpec.fileType,
|
||||
useInput: actionSpec.useInput,
|
||||
actionHandler: actionSpec.actionHandler,
|
||||
checkFilename: actionSpec.checkFilename
|
||||
checkFilename: actionSpec.checkFilename,
|
||||
shouldShow: actionSpec.shouldShow,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -220,10 +230,11 @@
|
|||
* Renders the menu with the currently set items
|
||||
*/
|
||||
render: function() {
|
||||
const menuItems = this._menuItems.filter(item => !item.shouldShow || (item.shouldShow instanceof Function && item.shouldShow() === true))
|
||||
this.$el.html(this.template({
|
||||
uploadMaxHumanFileSize: 'TODO',
|
||||
uploadLabel: t('files', 'Upload file'),
|
||||
items: this._menuItems
|
||||
items: menuItems
|
||||
}));
|
||||
|
||||
// Trigger upload action also with keyboard navigation on enter
|
||||
|
|
|
|||
Loading…
Reference in a new issue