From 9c58dc216ffec205e2c558235553e9a3e1516778 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 16 Jul 2018 16:17:34 +0200 Subject: [PATCH] Remove option to move a shared folder to the trash --- www/drive/inner.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/www/drive/inner.js b/www/drive/inner.js index 59db8824b..4de5ef4d6 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -836,6 +836,8 @@ define([ containsFolder = true; hide.push('openro'); hide.push('hashtag'); + hide.push('delete'); + //hide.push('deleteowned'); } else { // it's a folder if (containsFolder) { // More than 1 folder selected: cannot create a new subfolder @@ -852,11 +854,21 @@ define([ hide.push('properties'); } // If we're not in the trash nor in a shared folder, hide "remove" - if (!manager.isInSharedFolder(path)) { + var el = manager.find(path); + if (!manager.isInSharedFolder(path) + && !$element.is('.cp-app-drive-element-sharedf')) { hide.push('removesf'); } else if (type === "tree") { hide.push('delete'); - hide.push('deleteowned'); + // Don't hide the deleteowned link if the element is a shared folder and + // it is owned + if (manager.isInSharedFolder(path) || + !$element.is('.cp-app-drive-element-owned')) { + hide.push('deleteowned'); + } else { + // This is a shared folder and it is owned + hide.push('removesf'); + } } }); if (paths.length > 1) {