From 126498585e7dcd7aece07e7442f1b6879c814ad8 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 10 Apr 2017 11:44:11 +0200 Subject: [PATCH] Add a context menu on the ROOT folder in the drive --- www/drive/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/drive/main.js b/www/drive/main.js index 220ee5c11..2bf18d146 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -376,6 +376,10 @@ define([ paths.forEach(function (p, i) { var path = p.path; var $element = p.element; + if (path.length === 1) { + hide.push($menu.find('a.rename')); + hide.push($menu.find('a.delete')); + } if (!APP.editable) { hide.push($menu.find('a.editable')); } @@ -1709,6 +1713,7 @@ define([ (isRootOpened ? $folderOpenedIcon : $folderIcon); var $rootElement = createTreeElement(ROOT_NAME, $rootIcon.clone(), [ROOT], false, true, false, isRootOpened); $rootElement.addClass('root'); + $rootElement.find('>.element-row').contextmenu(openDirectoryContextMenu); var $root = $('