mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Add UI hint for moving shared folder inside shared folders
This commit is contained in:
parent
0239d9b335
commit
1552b0c8fc
@ -135,6 +135,7 @@ define(req, function(AppConfig, Default, Language) {
|
||||
};
|
||||
/// XXX
|
||||
Messages.fo_trash_move_error = "Shared items cannot be moved to your trash folder. Use \"Remove\" option to remove them from the drive instead.";
|
||||
Messages.fo_sharedFolder_move_error = "Shared folders cannot be moved inside other shared folders.";
|
||||
|
||||
return Messages;
|
||||
|
||||
|
||||
@ -2144,13 +2144,20 @@ define([
|
||||
var movedPaths = [];
|
||||
|
||||
var sharedF = false;
|
||||
var draggedSharedFolder = false;
|
||||
oldPaths.forEach(function (p) {
|
||||
movedPaths.push(p.path);
|
||||
if (!sharedF && manager.isInSharedFolder(p.path)) {
|
||||
sharedF = true;
|
||||
}
|
||||
if (!draggedSharedFolder && p.value && p.value.el && manager.isSharedFolder(p.value.el)) {
|
||||
draggedSharedFolder = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (draggedSharedFolder && manager.isInSharedFolder(newPath)) {
|
||||
return void UI.warn(Messages.fo_sharedFolder_move_error);
|
||||
}
|
||||
if (sharedF && manager.isPathIn(newPath, [TRASH])) {
|
||||
// TODO create a key here?
|
||||
// You can't move to YOUR trash documents stored in a shared folder
|
||||
|
||||
Loading…
Reference in New Issue
Block a user