mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
bulk-operations v0.1 adding Drag & Drop for moving items to navigations folders, add folders to favourites
This commit is contained in:
@@ -20,16 +20,18 @@ class FavouriteController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
// Validate request
|
||||
$validator = Validator::make($request->all(), [
|
||||
'unique_id' => 'required|integer',
|
||||
$validator = Validator::make($request->input('folders'), [
|
||||
'*.unique_id' => 'required|integer',
|
||||
]);
|
||||
|
||||
// Return error
|
||||
if ($validator->fails()) abort(400, 'Bad input');
|
||||
|
||||
foreach($request->input('folders') as $item) {
|
||||
|
||||
// Get user & folder
|
||||
$user = Auth::user();
|
||||
$folder = FileManagerFolder::where('unique_id', $request->unique_id)->first();
|
||||
$folder = FileManagerFolder::where('unique_id', $item['unique_id'])->first();
|
||||
|
||||
if (is_demo($user->id)) {
|
||||
return Demo::favourites($user);
|
||||
@@ -39,8 +41,9 @@ class FavouriteController extends Controller
|
||||
if ($folder->user_id !== $user->id) abort(403);
|
||||
|
||||
// Add folder to user favourites
|
||||
$user->favourite_folders()->syncWithoutDetaching($request->unique_id);
|
||||
$user->favourite_folders()->syncWithoutDetaching($item['unique_id']);
|
||||
|
||||
}
|
||||
// Return updated favourites
|
||||
return $user->favourite_folders;
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
"/chunks/database.js": "/chunks/database.js?id=416a5164bdc53c97ea34",
|
||||
"/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=464c8e70974d492ce7f6",
|
||||
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=405847df44edd86e301a",
|
||||
"/chunks/files.js": "/chunks/files.js?id=e0e01c40a7c37f170270",
|
||||
"/chunks/files.js": "/chunks/files.js?id=2d162960903ddec11553",
|
||||
"/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/trash~chunks~3ea7670b.js": "/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/trash~chunks~3ea7670b.js?id=6cafd70cb9e5ae25f02a",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js?id=3703e138e9d316a9d850",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js?id=4e72422c20acc07456e6",
|
||||
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=aba8c662fbc234892216",
|
||||
"/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=ecceaa6cdf5768826b36",
|
||||
"/chunks/invoices.js": "/chunks/invoices.js?id=248503ac5967fe8370f9",
|
||||
@@ -75,79 +75,56 @@
|
||||
"/chunks/user-storage.js": "/chunks/user-storage.js?id=a99910f95c3e39caa78b",
|
||||
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=e8ea1e67f9ac0a835ed0",
|
||||
"/chunks/users.js": "/chunks/users.js?id=cdba7af8fb0cd8e64c40",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c6be29fc8fb5f6066889.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c6be29fc8fb5f6066889.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.ddb66a6efe5bcb01ed50.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.ddb66a6efe5bcb01ed50.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.7aeb3b63de0a18f158dd.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.7aeb3b63de0a18f158dd.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.80b31c9384d68ca81426.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.80b31c9384d68ca81426.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.6bdf4bd28e383386a08f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.6bdf4bd28e383386a08f.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c687d4d9a48b5bf55b6d.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c687d4d9a48b5bf55b6d.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.d658f6bebc345fd0748b.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.d658f6bebc345fd0748b.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.62332b6c26a3a17243c9.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.62332b6c26a3a17243c9.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.32224af37576509ffc32.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.32224af37576509ffc32.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.3f516bc5454ea15bb769.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.3f516bc5454ea15bb769.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c37d7459aa7f09878c0a.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c37d7459aa7f09878c0a.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8c4daf554552aa20f374.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8c4daf554552aa20f374.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.a8773e02004276bf57de.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.a8773e02004276bf57de.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.3dd73d1160e4595d5106.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.3dd73d1160e4595d5106.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.68dcd7b1fc9b05db68f6.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.68dcd7b1fc9b05db68f6.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.f19c3e219f01eccd8fb3.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.f19c3e219f01eccd8fb3.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.2eccbc694b11b2efbc63.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.2eccbc694b11b2efbc63.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.38f836026c4fc800e3c4.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.38f836026c4fc800e3c4.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.9dfaf9f542df321ba991.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.9dfaf9f542df321ba991.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.73b7b39eefa288138dfc.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.73b7b39eefa288138dfc.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.5751401aba1adb64a925.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.5751401aba1adb64a925.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.06c57069549acfea652d.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.06c57069549acfea652d.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.52deb1b66739be132d70.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.52deb1b66739be132d70.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.985a286b1418248fc878.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.985a286b1418248fc878.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.cc7a2c5d70236867a163.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.cc7a2c5d70236867a163.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.0cb903ff08c25eb5d015.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.0cb903ff08c25eb5d015.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.90fb6e64be7464215f6f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.90fb6e64be7464215f6f.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.6378f26bda11216c9d7a.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.6378f26bda11216c9d7a.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.fc9d458b9024171d896f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.fc9d458b9024171d896f.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.ebafe3c3d8c3ca24226f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.ebafe3c3d8c3ca24226f.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.204578bdb6eba7d9459d.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.204578bdb6eba7d9459d.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.b374bcefda7eea419a77.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.b374bcefda7eea419a77.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.1297c60f82fcee404a0b.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.1297c60f82fcee404a0b.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8bb631240ea107faeee1.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8bb631240ea107faeee1.hot-update.js",
|
||||
"/js/main.aa14968f01b581f22523.hot-update.js": "/js/main.aa14968f01b581f22523.hot-update.js",
|
||||
"/chunks/dashboard.aa14968f01b581f22523.hot-update.js": "/chunks/dashboard.aa14968f01b581f22523.hot-update.js",
|
||||
"/chunks/dashboard~chunks/invoices~chunks/pages~chunks/plans~chunks/settings-payment-methods~chunks/users.js": "/chunks/dashboard~chunks/invoices~chunks/pages~chunks/plans~chunks/settings-payment-methods~chunks/users.js?id=2bb9ebac09457d3b898e",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.aa14968f01b581f22523.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.aa14968f01b581f22523.hot-update.js",
|
||||
"/chunks/invoices.aa14968f01b581f22523.hot-update.js": "/chunks/invoices.aa14968f01b581f22523.hot-update.js",
|
||||
"/chunks/pages.aa14968f01b581f22523.hot-update.js": "/chunks/pages.aa14968f01b581f22523.hot-update.js",
|
||||
"/chunks/plans.aa14968f01b581f22523.hot-update.js": "/chunks/plans.aa14968f01b581f22523.hot-update.js",
|
||||
"/chunks/settings-payment-methods.aa14968f01b581f22523.hot-update.js": "/chunks/settings-payment-methods.aa14968f01b581f22523.hot-update.js",
|
||||
"/chunks/users.aa14968f01b581f22523.hot-update.js": "/chunks/users.aa14968f01b581f22523.hot-update.js",
|
||||
"/js/main.957105d51b4b371c02f7.hot-update.js": "/js/main.957105d51b4b371c02f7.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.957105d51b4b371c02f7.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.957105d51b4b371c02f7.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.29c8874dfb2c94995650.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.29c8874dfb2c94995650.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.fe60ff9d657992a1b3fc.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.fe60ff9d657992a1b3fc.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.39547a50bad3eaef19d5.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.39547a50bad3eaef19d5.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.49f90f3476114215e153.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.49f90f3476114215e153.hot-update.js",
|
||||
"/js/main.b1e1c83f945ac034e4b6.hot-update.js": "/js/main.b1e1c83f945ac034e4b6.hot-update.js",
|
||||
"/js/main.09d58bdcd52e76eea49a.hot-update.js": "/js/main.09d58bdcd52e76eea49a.hot-update.js",
|
||||
"/js/main.0f77ad05525e6d1f485b.hot-update.js": "/js/main.0f77ad05525e6d1f485b.hot-update.js",
|
||||
"/js/main.c7508405578e74d6d5d0.hot-update.js": "/js/main.c7508405578e74d6d5d0.hot-update.js",
|
||||
"/js/main.03f879f9830de6d3b02d.hot-update.js": "/js/main.03f879f9830de6d3b02d.hot-update.js",
|
||||
"/js/main.13df6330a44eda756456.hot-update.js": "/js/main.13df6330a44eda756456.hot-update.js",
|
||||
"/js/main.a74beb7aef66d2190d52.hot-update.js": "/js/main.a74beb7aef66d2190d52.hot-update.js",
|
||||
"/js/main.5cd5987df958d7bb7eec.hot-update.js": "/js/main.5cd5987df958d7bb7eec.hot-update.js",
|
||||
"/js/main.3e7f55b2c44e25eb1164.hot-update.js": "/js/main.3e7f55b2c44e25eb1164.hot-update.js",
|
||||
"/js/main.457b5d135de215ee357d.hot-update.js": "/js/main.457b5d135de215ee357d.hot-update.js",
|
||||
"/js/main.9cbc62e607b82155c099.hot-update.js": "/js/main.9cbc62e607b82155c099.hot-update.js",
|
||||
"/js/main.7a48fee0a61738f74542.hot-update.js": "/js/main.7a48fee0a61738f74542.hot-update.js",
|
||||
"/js/main.c6167479106cf4d6528d.hot-update.js": "/js/main.c6167479106cf4d6528d.hot-update.js",
|
||||
"/js/main.78b0f051b1396111d2f1.hot-update.js": "/js/main.78b0f051b1396111d2f1.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.9a0fe6f8a67a58879bca.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.9a0fe6f8a67a58879bca.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.9b35209ca84faca947c0.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.9b35209ca84faca947c0.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.a674fdf77aea80c0529b.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.a674fdf77aea80c0529b.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.97d913769431b05cc7c2.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.97d913769431b05cc7c2.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8cf94a788280336dda73.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8cf94a788280336dda73.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.3af71b38ca39f36d99e4.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.3af71b38ca39f36d99e4.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.401b03e61a5ab310bb94.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.401b03e61a5ab310bb94.hot-update.js",
|
||||
"/js/main.6f45362ec6c423157bfe.hot-update.js": "/js/main.6f45362ec6c423157bfe.hot-update.js",
|
||||
"/js/main.3644cc8d59343b060b54.hot-update.js": "/js/main.3644cc8d59343b060b54.hot-update.js",
|
||||
"/js/main.946a09d801c105987d08.hot-update.js": "/js/main.946a09d801c105987d08.hot-update.js",
|
||||
"/js/main.2558534849562d05fae1.hot-update.js": "/js/main.2558534849562d05fae1.hot-update.js",
|
||||
"/js/main.9d6ddebbc75464578783.hot-update.js": "/js/main.9d6ddebbc75464578783.hot-update.js"
|
||||
"/chunks/files.714998938066a2321d6a.hot-update.js": "/chunks/files.714998938066a2321d6a.hot-update.js",
|
||||
"/chunks/files.60eb046f4a1a6c202c55.hot-update.js": "/chunks/files.60eb046f4a1a6c202c55.hot-update.js",
|
||||
"/chunks/files.7fdeb696aa4bed8f19de.hot-update.js": "/chunks/files.7fdeb696aa4bed8f19de.hot-update.js",
|
||||
"/chunks/files.b2938bf5a1bd4060083a.hot-update.js": "/chunks/files.b2938bf5a1bd4060083a.hot-update.js",
|
||||
"/chunks/files.8f60f48f3d093aa99eb4.hot-update.js": "/chunks/files.8f60f48f3d093aa99eb4.hot-update.js",
|
||||
"/chunks/files.7ed16adadf0572bbb9c5.hot-update.js": "/chunks/files.7ed16adadf0572bbb9c5.hot-update.js",
|
||||
"/chunks/files.7b75e2b42ad4d4c9f91e.hot-update.js": "/chunks/files.7b75e2b42ad4d4c9f91e.hot-update.js",
|
||||
"/chunks/files.fd675a976f14fdaace03.hot-update.js": "/chunks/files.fd675a976f14fdaace03.hot-update.js",
|
||||
"/chunks/files.982ab03f0a0254ba8f45.hot-update.js": "/chunks/files.982ab03f0a0254ba8f45.hot-update.js",
|
||||
"/chunks/files.4458a0a295466f44abd7.hot-update.js": "/chunks/files.4458a0a295466f44abd7.hot-update.js",
|
||||
"/chunks/files.554b28cc5fada61962f8.hot-update.js": "/chunks/files.554b28cc5fada61962f8.hot-update.js",
|
||||
"/chunks/files.48b60c1642d609002311.hot-update.js": "/chunks/files.48b60c1642d609002311.hot-update.js",
|
||||
"/chunks/files.e99bf422cb068c92284f.hot-update.js": "/chunks/files.e99bf422cb068c92284f.hot-update.js",
|
||||
"/chunks/files.c11703d2b53e55fcf007.hot-update.js": "/chunks/files.c11703d2b53e55fcf007.hot-update.js",
|
||||
"/chunks/files.c8e8a976ff2dff3f0641.hot-update.js": "/chunks/files.c8e8a976ff2dff3f0641.hot-update.js",
|
||||
"/chunks/files.6f4b3065df89afbd103b.hot-update.js": "/chunks/files.6f4b3065df89afbd103b.hot-update.js",
|
||||
"/chunks/files.d7db5f7991bb774eef03.hot-update.js": "/chunks/files.d7db5f7991bb774eef03.hot-update.js",
|
||||
"/chunks/files.626a2a2eb02181f64d2a.hot-update.js": "/chunks/files.626a2a2eb02181f64d2a.hot-update.js",
|
||||
"/chunks/files.e1214cf94c07e3639f27.hot-update.js": "/chunks/files.e1214cf94c07e3639f27.hot-update.js",
|
||||
"/chunks/files.630b64c8c69d724208f7.hot-update.js": "/chunks/files.630b64c8c69d724208f7.hot-update.js",
|
||||
"/chunks/files.95f3da8f311ad657c9d1.hot-update.js": "/chunks/files.95f3da8f311ad657c9d1.hot-update.js",
|
||||
"/chunks/files.619d7f534b93897facde.hot-update.js": "/chunks/files.619d7f534b93897facde.hot-update.js",
|
||||
"/chunks/files.35a4d628dffd37f253bc.hot-update.js": "/chunks/files.35a4d628dffd37f253bc.hot-update.js",
|
||||
"/chunks/files.ce9553d82fb1fda6e2e9.hot-update.js": "/chunks/files.ce9553d82fb1fda6e2e9.hot-update.js",
|
||||
"/chunks/files.a39fdc4318e92c023609.hot-update.js": "/chunks/files.a39fdc4318e92c023609.hot-update.js",
|
||||
"/chunks/files.8a2c99114c50b7521355.hot-update.js": "/chunks/files.8a2c99114c50b7521355.hot-update.js",
|
||||
"/chunks/files.3867e89249b4bfb9f547.hot-update.js": "/chunks/files.3867e89249b4bfb9f547.hot-update.js",
|
||||
"/chunks/files.daa03c7cb15b7a6dd0ad.hot-update.js": "/chunks/files.daa03c7cb15b7a6dd0ad.hot-update.js",
|
||||
"/chunks/files.c30f881608ff354918b2.hot-update.js": "/chunks/files.c30f881608ff354918b2.hot-update.js",
|
||||
"/chunks/files.f3c874fb14bf3460697c.hot-update.js": "/chunks/files.f3c874fb14bf3460697c.hot-update.js",
|
||||
"/chunks/files.737862853174ce1e11c1.hot-update.js": "/chunks/files.737862853174ce1e11c1.hot-update.js",
|
||||
"/chunks/files.704475025e033b2e6cb4.hot-update.js": "/chunks/files.704475025e033b2e6cb4.hot-update.js",
|
||||
"/chunks/files.9202c89939570a22ebe9.hot-update.js": "/chunks/files.9202c89939570a22ebe9.hot-update.js",
|
||||
"/chunks/files.2dad5b52bdb08312a195.hot-update.js": "/chunks/files.2dad5b52bdb08312a195.hot-update.js",
|
||||
"/chunks/files.ad6390cad01a851024ba.hot-update.js": "/chunks/files.ad6390cad01a851024ba.hot-update.js",
|
||||
"/chunks/files.0fe96aa3cf88c4dad880.hot-update.js": "/chunks/files.0fe96aa3cf88c4dad880.hot-update.js",
|
||||
"/chunks/files.a7aef636159b3db9e096.hot-update.js": "/chunks/files.a7aef636159b3db9e096.hot-update.js",
|
||||
"/chunks/files.83b3e9445cf85e4d2e23.hot-update.js": "/chunks/files.83b3e9445cf85e4d2e23.hot-update.js",
|
||||
"/chunks/files.920cb523e56b9c951e4e.hot-update.js": "/chunks/files.920cb523e56b9c951e4e.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.f357a2647ab1b743293f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.f357a2647ab1b743293f.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.cee1ccc30596a6782e23.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.cee1ccc30596a6782e23.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.e11292d5f2fc27b48459.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.e11292d5f2fc27b48459.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.47938fbb519b1236d212.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.47938fbb519b1236d212.hot-update.js",
|
||||
"/chunks/files.745653f9c181560ad982.hot-update.js": "/chunks/files.745653f9c181560ad982.hot-update.js",
|
||||
"/chunks/files.f1b53bfaafa441199e99.hot-update.js": "/chunks/files.f1b53bfaafa441199e99.hot-update.js",
|
||||
"/js/main.7008e73204e087dc5684.hot-update.js": "/js/main.7008e73204e087dc5684.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.540cc212a6ffd91f7a8b.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.540cc212a6ffd91f7a8b.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c88f76c4b7bb73d3ab50.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c88f76c4b7bb73d3ab50.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.673fc125bc6c0154d453.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.673fc125bc6c0154d453.hot-update.js",
|
||||
"/js/main.5676c74fd7fab45827fd.hot-update.js": "/js/main.5676c74fd7fab45827fd.hot-update.js",
|
||||
"/chunks/files.b6cd1945c2de9a6461d9.hot-update.js": "/chunks/files.b6cd1945c2de9a6461d9.hot-update.js",
|
||||
"/js/main.541844d93d4d8469353e.hot-update.js": "/js/main.541844d93d4d8469353e.hot-update.js"
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{{ $t('context_menu.move') }}
|
||||
</div>
|
||||
</li>
|
||||
<li class="menu-option" @click="shareItem">
|
||||
<li class="menu-option" @click="shareItem" v-if="$checkPermission('master')">
|
||||
<div class="icon">
|
||||
<link-icon size="17"></link-icon>
|
||||
</div>
|
||||
@@ -158,7 +158,7 @@
|
||||
$checkPermission('master') && !showFromPreview
|
||||
" id="menu-list" class="menu-options">
|
||||
<ul class="menu-option-group" v-if="!$isThisLocation(['participant_uploads', 'latest'])">
|
||||
<li class="menu-option" @click="addToFavourites" v-if="item && isFolder && multiSelectContextMenu">
|
||||
<li class="menu-option" @click="addToFavourites" v-if="item && isFolder && multiSelectContextMenu ">
|
||||
<div class="icon">
|
||||
<star-icon size="17"></star-icon>
|
||||
</div>
|
||||
@@ -338,9 +338,12 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['user', 'fileInfoDetail']),
|
||||
multiSelectContextMenu() {
|
||||
if(this.fileInfoDetail.length > 1 && this.fileInfoDetail.includes(this.item)) {
|
||||
|
||||
// If is context Menu open on multi selected items open just options for the multi selected items
|
||||
if(this.fileInfoDetail.length > 1 && this.fileInfoDetail.includes(this.item)) {
|
||||
return false
|
||||
}
|
||||
// If is context Menu open for the non selected item open options for the single item
|
||||
if(this.fileInfoDetail.length < 2 || !this.fileInfoDetail.includes(this.item)) {
|
||||
return true
|
||||
}
|
||||
@@ -364,7 +367,7 @@ export default {
|
||||
},
|
||||
isInFavourites() {
|
||||
return this.favourites.find((el) => el.unique_id == this.item.unique_id)
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -414,7 +417,15 @@ export default {
|
||||
this.favourites &&
|
||||
!this.favourites.find((el) => el.unique_id == this.item.unique_id)
|
||||
) {
|
||||
//Add to favourite folder that is not selected
|
||||
if(!this.fileInfoDetail.includes(this.item)){
|
||||
this.$store.dispatch('addToFavourites', this.item)
|
||||
}
|
||||
|
||||
//Add to favourites all selected folders
|
||||
if(this.fileInfoDetail.includes(this.item)) {
|
||||
this.$store.dispatch('addToFavourites', null)
|
||||
}
|
||||
} else {
|
||||
this.$store.dispatch('removeFromFavourites', this.item)
|
||||
}
|
||||
@@ -435,7 +446,14 @@ export default {
|
||||
},
|
||||
deleteItem() {
|
||||
// Dispatch remove item
|
||||
this.$store.dispatch('deleteItem', this.item)
|
||||
// If is contet menu open on non selected item delete this single item
|
||||
if(!this.fileInfoDetail.includes(this.item)){
|
||||
this.$store.dispatch('deleteItem', this.item)
|
||||
}
|
||||
// If is context menu open to multi selected items dele this selected items
|
||||
if(this.fileInfoDetail.includes(this.item)) {
|
||||
this.$store.dispatch('deleteItem')
|
||||
}
|
||||
},
|
||||
createFolder() {
|
||||
// Create folder
|
||||
|
||||
@@ -149,11 +149,9 @@ export default {
|
||||
return this.FilePreviewType === "list" ? "th" : "th-list";
|
||||
},
|
||||
canCreateFolderInView() {
|
||||
let location = !this.$isThisLocation(["base", "public"]);
|
||||
let locations = ["base", "public"];
|
||||
|
||||
if(location || this.fileInfoDetail.length >1) {
|
||||
return true
|
||||
}
|
||||
return !this.$isThisLocation(locations) || this.fileInfoDetail.length > 1
|
||||
},
|
||||
canDeleteInView() {
|
||||
return !this.$isThisLocation([
|
||||
@@ -167,10 +165,9 @@ export default {
|
||||
]);
|
||||
},
|
||||
canUploadInView() {
|
||||
let location = !this.$isThisLocation(["base", "public"]);
|
||||
if(location || this.fileInfoDetail.length >1) {
|
||||
return true
|
||||
}
|
||||
let locations = ["base", "public"]
|
||||
|
||||
return !this.$isThisLocation(locations) || this.fileInfoDetail.length > 1
|
||||
},
|
||||
canMoveInView() {
|
||||
return !this.$isThisLocation([
|
||||
@@ -182,16 +179,15 @@ export default {
|
||||
]);
|
||||
},
|
||||
canShareInView() {
|
||||
let location = !this.$isThisLocation([
|
||||
let locations = [
|
||||
"base",
|
||||
"participant_uploads",
|
||||
"latest",
|
||||
"shared",
|
||||
"public",
|
||||
]);
|
||||
if(location || this.fileInfoDetail.length > 1) {
|
||||
return true
|
||||
}
|
||||
]
|
||||
|
||||
return !this.$isThisLocation(locations) || this.fileInfoDetail.length > 1
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -161,12 +161,23 @@
|
||||
dragFinish(data, event) {
|
||||
|
||||
if (event.dataTransfer.items.length == 0) {
|
||||
|
||||
|
||||
// Prevent to drop on file or image
|
||||
if (data.type !== 'folder' || this.draggingId === data) return
|
||||
|
||||
//Prevent move selected folder to folder if in beteewn selected folders
|
||||
if(this.fileInfoDetail.find(item => item === data)) return
|
||||
// Move folder to new parent
|
||||
this.$store.dispatch('moveItem', [this.draggingId, data])
|
||||
|
||||
//Move selected items to folder
|
||||
if(this.fileInfoDetail.length > 0 && this.fileInfoDetail.includes(this.draggingId)){
|
||||
this.$store.dispatch('moveItem', {to_item:data ,noSelectedItem: null})
|
||||
}
|
||||
|
||||
//Move item if is not included in selected items
|
||||
if(this.fileInfoDetail.length === 0 || !this.fileInfoDetail.includes(this.draggingId)){
|
||||
this.$store.dispatch('moveItem', {to_item:data ,noSelectedItem:this.draggingId})
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -200,6 +211,10 @@
|
||||
this.mobileMultiSelect = false
|
||||
})
|
||||
|
||||
events.$on('drop', () => {
|
||||
this.isDragging = false
|
||||
})
|
||||
|
||||
events.$on('fileItem:deselect', () =>
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
)
|
||||
|
||||
@@ -10,23 +10,23 @@
|
||||
:draggable="canDrag"
|
||||
@dragstart="$emit('dragstart')"
|
||||
@drop="
|
||||
$emit('drop')
|
||||
drop()
|
||||
area = false
|
||||
"
|
||||
@dragleave="dragLeave"
|
||||
@dragover.prevent="dragEnter"
|
||||
class="file-item"
|
||||
:class="{'is-clicked' : isClicked , 'no-clicked' : !isClicked, 'is-dragenter': area }"
|
||||
:class="{'is-clicked' : isClicked , 'no-clicked' : !isClicked && this.$isMobile(), 'is-dragenter': area }"
|
||||
>
|
||||
<!--Thumbnail for item-->
|
||||
<div class="icon-item">
|
||||
|
||||
<div :class="{'check-select-folder' : this.data.type === 'folder', 'check-select' : this.data.type !== 'folder'}" v-if="mobileMultiSelect">
|
||||
<div class="select-box" :class="{'select-box-active' : isClicked } ">
|
||||
<!-- <p>|</p> -->
|
||||
<CheckIcon v-if="isClicked" class="icon" size="17"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- MultiSelecting for the mobile version -->
|
||||
<div :class="{'check-select-folder' : this.data.type === 'folder', 'check-select' : this.data.type !== 'folder'}" v-if="mobileMultiSelect">
|
||||
<div class="select-box" :class="{'select-box-active' : isClicked } ">
|
||||
<CheckIcon v-if="isClicked" class="icon" size="17"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--If is file or image, then link item-->
|
||||
<span v-if="isFile" class="file-icon-text">
|
||||
@@ -105,11 +105,7 @@
|
||||
]),
|
||||
...mapGetters({allData: 'data'}),
|
||||
isClicked() {
|
||||
if(this.fileInfoDetail.some(element => element.unique_id == this.data.unique_id)){
|
||||
return true
|
||||
}else {
|
||||
return false
|
||||
}
|
||||
return this.fileInfoDetail.some(element => element.unique_id == this.data.unique_id)
|
||||
},
|
||||
isFolder() {
|
||||
return this.data.type === 'folder'
|
||||
@@ -160,6 +156,9 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
drop() {
|
||||
events.$emit('drop')
|
||||
},
|
||||
showItemActions() {
|
||||
// Load file info detail
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
@@ -170,6 +169,8 @@
|
||||
dragEnter() {
|
||||
if (this.data.type !== 'folder') return
|
||||
|
||||
if(this.fileInfoDetail.includes(this.data)) return
|
||||
|
||||
this.area = true
|
||||
},
|
||||
dragLeave() {
|
||||
@@ -334,7 +335,7 @@
|
||||
box-shadow: 0 3px 15px 2px hsla(220, 36%, 16%, 0.05);
|
||||
}
|
||||
.select-box-active {
|
||||
background-color: $text !important;
|
||||
background-color: $text ;
|
||||
.icon {
|
||||
stroke: white;
|
||||
}
|
||||
@@ -584,7 +585,7 @@
|
||||
background-color: $dark_mode_foreground;
|
||||
}
|
||||
.select-box-active {
|
||||
background-color: $dark_mode_text_primary !important;
|
||||
background-color: $dark_mode_text_primary ;
|
||||
.icon {
|
||||
stroke: $text;
|
||||
}
|
||||
@@ -619,7 +620,7 @@
|
||||
|
||||
path {
|
||||
fill: $dark_mode_foreground !important;
|
||||
stroke: #2F3C54 !important;
|
||||
stroke: #2F3C54 ;
|
||||
}
|
||||
}
|
||||
.item-name {
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
:draggable="canDrag"
|
||||
@dragstart="$emit('dragstart')"
|
||||
@drop="
|
||||
$emit('drop')
|
||||
drop()
|
||||
area = false
|
||||
"
|
||||
@dragleave="dragLeave"
|
||||
@dragover.prevent="dragEnter"
|
||||
class="file-item"
|
||||
:class="{'is-clicked' : isClicked , 'no-clicked' : !isClicked, 'is-dragenter': area }"
|
||||
:class="{'is-clicked' : isClicked , 'no-clicked' : !isClicked && this.$isMobile(), 'is-dragenter': area }"
|
||||
>
|
||||
|
||||
<div class="check-select" v-if="mobileMultiSelect">
|
||||
@@ -94,11 +94,7 @@ export default {
|
||||
...mapGetters(['FilePreviewType', 'fileInfoDetail' ]),
|
||||
...mapGetters({allData: 'data'}),
|
||||
isClicked() {
|
||||
if(this.fileInfoDetail.some(element => element.unique_id == this.data.unique_id)){
|
||||
return true
|
||||
}else {
|
||||
return false
|
||||
}
|
||||
return this.fileInfoDetail.some(element => element.unique_id == this.data.unique_id)
|
||||
},
|
||||
isFolder() {
|
||||
return this.data.type === 'folder'
|
||||
@@ -152,6 +148,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
drop() {
|
||||
events.$emit('drop')
|
||||
},
|
||||
showItemActions() {
|
||||
// Load file info detail
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
@@ -162,6 +161,8 @@ export default {
|
||||
dragEnter() {
|
||||
if (this.data.type !== 'folder') return
|
||||
|
||||
if(this.fileInfoDetail.includes(this.data)) return
|
||||
|
||||
this.area = true
|
||||
},
|
||||
dragLeave() {
|
||||
@@ -280,6 +281,7 @@ export default {
|
||||
|
||||
events.$on('fileItem:deselect', () => {
|
||||
// Deselect file
|
||||
if(this.fileInfoDetail.length > 0)
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
})
|
||||
|
||||
@@ -309,7 +311,7 @@ export default {
|
||||
box-shadow: 0 3px 15px 2px hsla(220, 36%, 16%, 0.05);
|
||||
}
|
||||
.select-box-active {
|
||||
background-color: $text !important;
|
||||
background-color: $text ;
|
||||
.icon {
|
||||
stroke: white;
|
||||
}
|
||||
@@ -492,17 +494,17 @@ export default {
|
||||
background: white !important;
|
||||
.item-name {
|
||||
.name {
|
||||
color: $text !important;
|
||||
color: $text !important ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:hover ,
|
||||
&.is-clicked {
|
||||
border-radius: 8px;
|
||||
background: $light_background ;
|
||||
.item-name .name {
|
||||
color: $theme;
|
||||
color: $theme ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -514,7 +516,7 @@ export default {
|
||||
background-color: $dark_mode_foreground;
|
||||
}
|
||||
.select-box-active {
|
||||
background-color: $dark_mode_text_primary !important;
|
||||
background-color: $dark_mode_text_primary ;
|
||||
.icon {
|
||||
stroke: $text;
|
||||
}
|
||||
@@ -546,7 +548,7 @@ export default {
|
||||
|
||||
path {
|
||||
fill: $dark_mode_foreground !important;
|
||||
stroke: #2F3C54 !important;
|
||||
stroke: #2F3C54 ;
|
||||
}
|
||||
}
|
||||
.item-name {
|
||||
@@ -556,15 +558,19 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
&:hover,
|
||||
&.is-clicked {
|
||||
background: $dark_mode_foreground;
|
||||
&:hover,
|
||||
&.is-clicked {
|
||||
background: $dark_mode_foreground ;
|
||||
|
||||
.file-icon {
|
||||
path {
|
||||
fill: $dark_mode_background;
|
||||
}
|
||||
.item-name .name {
|
||||
color: $theme ;
|
||||
}
|
||||
|
||||
.file-icon {
|
||||
path {
|
||||
fill: $dark_mode_background ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{{ previewText }}
|
||||
</MobileActionButton>
|
||||
<MobileMultiSelectButton @click.native="mobileMultiSelect = !mobileMultiSelect">
|
||||
Select
|
||||
{{ $t('context_menu.select') }}
|
||||
</MobileMultiSelectButton>
|
||||
<MobileActionButton @click.native="$store.dispatch('emptyTrash')" icon="trash">
|
||||
{{ $t('context_menu.empty_trash') }}
|
||||
@@ -23,7 +23,7 @@
|
||||
{{ $t('context_menu.upload') }}
|
||||
</MobileActionButtonUpload>
|
||||
<MobileMultiSelectButton @click.native="mobileMultiSelect = !mobileMultiSelect">
|
||||
Select
|
||||
{{ $t('context_menu.select') }}
|
||||
</MobileMultiSelectButton>
|
||||
<MobileActionButton @click.native="switchPreview" :icon="previewIcon">
|
||||
{{ previewText }}
|
||||
@@ -79,11 +79,9 @@
|
||||
|
||||
if(this.mobileMultiSelect ) {
|
||||
events.$emit('mobileSelecting-start')
|
||||
// this.mobileMultiSelect = true
|
||||
}
|
||||
if(!this.mobileMultiSelect) {
|
||||
events.$emit('mobileSelecting-stop')
|
||||
// this.mobileSelecting = false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<ToolbarButton
|
||||
v-if="
|
||||
!$isThisLocation(['trash', 'trash-root']) &&
|
||||
$checkPermission('master')
|
||||
$checkPermission('master') || $checkPermission('editor')
|
||||
"
|
||||
source="move"
|
||||
:action="$t('actions.move')"
|
||||
@@ -386,11 +386,14 @@ export default {
|
||||
},
|
||||
moveItem() {
|
||||
// Open move item popup
|
||||
|
||||
//Move item if is not selected
|
||||
if(!this.mobileMultiSelect) {
|
||||
let item = this.fileInfoDetail[0]
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
events.$emit('popup:open', { name: 'move', item: [item] })
|
||||
}
|
||||
//Move all selected items
|
||||
if(this.mobileMultiSelect) {
|
||||
events.$emit('popup:open', { name: 'move', item: [this.fileInfoDetail[0]] })
|
||||
}
|
||||
@@ -507,6 +510,9 @@ export default {
|
||||
|
||||
.mobile-selected-menu-wrapper {
|
||||
z-index: 1;
|
||||
.options {
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-selected-menu {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<CheckSquareIcon class="icon" size="21"/>
|
||||
</div>
|
||||
<div class="text">
|
||||
<span class="title">Selected Multiple Items</span>
|
||||
<span class="count">{{this.fileInfoDetail.length}} items</span>
|
||||
<span class="title">{{ $t('file_detail.selected_multiple') }}</span>
|
||||
<span class="count">{{this.fileInfoDetail.length}} {{ $tc('file_detail.items', this.fileInfoDetail.length) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -108,7 +108,15 @@ import {mapGetters} from 'vuex'
|
||||
.title {
|
||||
color: $dark_mode_text_primary;
|
||||
}
|
||||
}
|
||||
.count {
|
||||
color: $dark_mode_text_secondary;
|
||||
}
|
||||
}
|
||||
.icon-wrapper {
|
||||
.icon {
|
||||
stroke: $theme;
|
||||
}
|
||||
}
|
||||
}
|
||||
.move-item {
|
||||
.text {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<MultiSelected class="multiple-selected" moveItem="true" v-if="fileInfoDetail.length > 1 && !noSelectedItem"/>
|
||||
|
||||
<TreeMenu :depth="1" :nodes="items" v-for="items in navigation" :key="items.unique_id"/>
|
||||
<TreeMenu :disabled-by-id="pickedItem.unique_id" :depth="1" :nodes="items" v-for="items in navigation" :key="items.unique_id"/>
|
||||
</div>
|
||||
</PopupContent>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!--Folder Icon-->
|
||||
<div class="folder-item-wrapper" :class="{'is-inactive': !disableId} ">
|
||||
<div class="folder-item-wrapper" :class="{'is-inactive': disabledById && disabledById === nodes.unique_id || !disableId} ">
|
||||
|
||||
<div class="folder-item" :class="{'is-selected': isSelected}" @click="getFolder" :style="indent">
|
||||
<chevron-right-icon @click.stop="showTree" size="17" class="icon-arrow" :class="{'is-opened': isVisible, 'is-visible': nodes.folders.length !== 0}"></chevron-right-icon>
|
||||
@@ -9,7 +9,7 @@
|
||||
<span class="label">{{ nodes.name }}</span>
|
||||
</div>
|
||||
|
||||
<TreeMenu :depth="depth + 1" v-if="isVisible" :nodes="item" v-for="item in nodes.folders" :key="item.unique_id" />
|
||||
<TreeMenu :disabled-by-id="disabledById" :depth="depth + 1" v-if="isVisible" :nodes="item" v-for="item in nodes.folders" :key="item.unique_id" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
export default {
|
||||
name: 'TreeMenu',
|
||||
props: [
|
||||
'nodes', 'depth',
|
||||
'nodes', 'depth', 'disabledById'
|
||||
],
|
||||
components: {
|
||||
ChevronRightIcon,
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
<template>
|
||||
<transition name="folder">
|
||||
<div class="folder-item-wrapper">
|
||||
<div class="folder-item-wrapper" >
|
||||
|
||||
<div class="folder-item" :class="{'is-selected': isSelected}" :style="indent" @click="getFolder">
|
||||
<div class="folder-item" :class="{'is-selected': isSelected , 'is-dragenter': area, 'is-inactive': disabledFolder || disabled && draggedItem.length > 0 }"
|
||||
:style="indent" @click="getFolder"
|
||||
@dragover.prevent="dragEnter"
|
||||
@dragleave="dragLeave"
|
||||
@drop="dragFinish()"
|
||||
|
||||
>
|
||||
<chevron-right-icon @click.stop="showTree" size="17" class="icon-arrow"
|
||||
:class="{'is-opened': isVisible, 'is-visible': nodes.folders.length !== 0}"></chevron-right-icon>
|
||||
<folder-icon size="17" class="icon"></folder-icon>
|
||||
<span class="label">{{ nodes.name }}</span>
|
||||
</div>
|
||||
|
||||
<TreeMenuNavigator :depth="depth + 1" v-if="isVisible" :nodes="item" v-for="item in nodes.folders"
|
||||
<TreeMenuNavigator :disabled="disableChildren" :depth="depth + 1" v-if="isVisible" :nodes="item" v-for="item in nodes.folders"
|
||||
:key="item.unique_id"/>
|
||||
</div>
|
||||
</transition>
|
||||
@@ -18,12 +24,13 @@
|
||||
<script>
|
||||
import TreeMenuNavigator from '@/components/Others/TreeMenuNavigator'
|
||||
import {FolderIcon, ChevronRightIcon} from 'vue-feather-icons'
|
||||
import { mapGetters } from 'vuex'
|
||||
import {events} from "@/bus"
|
||||
|
||||
export default {
|
||||
name: 'TreeMenuNavigator',
|
||||
props: [
|
||||
'nodes', 'depth'
|
||||
'nodes', 'depth' , 'disabled',
|
||||
],
|
||||
components: {
|
||||
TreeMenuNavigator,
|
||||
@@ -31,6 +38,29 @@
|
||||
FolderIcon,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['fileInfoDetail']),
|
||||
|
||||
disabledFolder() {
|
||||
let disableFolder = false
|
||||
if(this.draggedItem.length > 0) {
|
||||
|
||||
this.draggedItem.forEach(item => {
|
||||
//Disable the parent of the folder
|
||||
if(item.type === "folder" && this.nodes.unique_id === item.parent_id){
|
||||
disableFolder = true
|
||||
}
|
||||
//Disable the self folder with all children
|
||||
if (this.nodes.unique_id === item.unique_id && item.type === 'folder') {
|
||||
disableFolder = true
|
||||
this.disableChildren = true
|
||||
}
|
||||
})
|
||||
}else {
|
||||
disableFolder = false
|
||||
this.disableChildren = false
|
||||
}
|
||||
return disableFolder
|
||||
},
|
||||
indent() {
|
||||
|
||||
let offset = window.innerWidth <= 1024 ? 17 : 22;
|
||||
@@ -44,9 +74,34 @@
|
||||
return {
|
||||
isVisible: false,
|
||||
isSelected: false,
|
||||
area:false,
|
||||
draggedItem:[],
|
||||
disableChildren:false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dragFinish() {
|
||||
// Move item
|
||||
//Move no selected item
|
||||
if(!this.fileInfoDetail.includes(this.draggedItem[0])) {
|
||||
this.$store.dispatch('moveItem', {to_item: this.nodes ,noSelectedItem:this.draggedItem[0]})
|
||||
this.draggedItem = []
|
||||
}
|
||||
//Move all selected items
|
||||
if(this.fileInfoDetail.includes(this.draggedItem[0])) {
|
||||
this.$store.dispatch('moveItem', {to_item: this.nodes ,noSelectedItem:null})
|
||||
this.draggedItem = []
|
||||
}
|
||||
this.area = false
|
||||
events.$emit('drop')
|
||||
|
||||
},
|
||||
dragEnter() {
|
||||
this.area = true
|
||||
},
|
||||
dragLeave() {
|
||||
this.area = false
|
||||
},
|
||||
getFolder() {
|
||||
|
||||
events.$emit('show-folder', this.nodes)
|
||||
@@ -59,6 +114,22 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
events.$on('drop' , () => {
|
||||
this.draggedItem = []
|
||||
})
|
||||
|
||||
//Get draged item
|
||||
events.$on('dragstart' , (data) => {
|
||||
//If is draged item not selected
|
||||
if(!this.fileInfoDetail.includes(data)) {
|
||||
this.draggedItem = [data]
|
||||
}
|
||||
//If are the draged items selected
|
||||
if(this.fileInfoDetail.includes(data)) {
|
||||
this.draggedItem = this.fileInfoDetail
|
||||
}
|
||||
})
|
||||
|
||||
// Select clicked folder
|
||||
events.$on('show-folder', node => {
|
||||
@@ -75,6 +146,16 @@
|
||||
@import '@assets/vue-file-manager/_variables';
|
||||
@import '@assets/vue-file-manager/_mixins';
|
||||
|
||||
.is-inactive {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.is-dragenter {
|
||||
border: 2px dashed $theme;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.folder-item {
|
||||
display: block;
|
||||
padding: 8px 0;
|
||||
|
||||
@@ -274,7 +274,8 @@
|
||||
"restore": "恢复文件",
|
||||
"share": "分享",
|
||||
"share_edit": "编辑分享设定",
|
||||
"upload": "上传"
|
||||
"upload": "上传",
|
||||
"select": "Select"
|
||||
},
|
||||
"cookie_disclaimer": {
|
||||
"button": "cookies policy",
|
||||
@@ -297,7 +298,9 @@
|
||||
"created_at": "创建于",
|
||||
"shared": "分享",
|
||||
"size": "大小",
|
||||
"where": "地址"
|
||||
"where": "地址",
|
||||
"selected_multiple": "Selected Multiple Items",
|
||||
"items": "Items"
|
||||
},
|
||||
"file_detail_meta": {
|
||||
"dimension": "Dimensions",
|
||||
|
||||
@@ -276,7 +276,8 @@
|
||||
"restore": "Restore",
|
||||
"share": "Share",
|
||||
"share_edit": "Edit Sharing",
|
||||
"upload": "Upload"
|
||||
"upload": "Upload",
|
||||
"select": "Select"
|
||||
},
|
||||
"cookie_disclaimer": {
|
||||
"button": "cookies policy",
|
||||
@@ -299,7 +300,9 @@
|
||||
"created_at": "Created at",
|
||||
"shared": "Shared",
|
||||
"size": "Size",
|
||||
"where": "Where"
|
||||
"where": "Where",
|
||||
"selected_multiple": "Selected Multiple Items",
|
||||
"items": "Items"
|
||||
},
|
||||
"file_detail_meta": {
|
||||
"dimension": "Dimensions",
|
||||
|
||||
@@ -276,7 +276,8 @@
|
||||
"restore": "Obnoviť",
|
||||
"share": "Zdieľať",
|
||||
"share_edit": "Upraviť zdieľanie",
|
||||
"upload": "Nahrať"
|
||||
"upload": "Nahrať",
|
||||
"select": "Výber"
|
||||
},
|
||||
"cookie_disclaimer": {
|
||||
"button": "politikou cookies",
|
||||
@@ -299,7 +300,9 @@
|
||||
"created_at": "Vytvorené",
|
||||
"shared": "Zdieľané",
|
||||
"size": "Veľkosť",
|
||||
"where": "Umiestnenie"
|
||||
"where": "Umiestnenie",
|
||||
"selected_multiple": "Vybratých viac položiek",
|
||||
"items": "{count} Položky | {count} Položiek"
|
||||
},
|
||||
"file_detail_meta": {
|
||||
"dimension": "Dimenzie",
|
||||
|
||||
6
resources/js/store/modules/fileFunctions.js
vendored
6
resources/js/store/modules/fileFunctions.js
vendored
@@ -8,7 +8,6 @@ import { Store } from 'vuex'
|
||||
const actions = {
|
||||
moveItem: ({commit, getters, dispatch}, {to_item ,noSelectedItem}) => {
|
||||
|
||||
|
||||
let itemsToMove = []
|
||||
let items = [noSelectedItem]
|
||||
|
||||
@@ -25,6 +24,11 @@ const actions = {
|
||||
})
|
||||
})
|
||||
|
||||
// Remove file preview
|
||||
if(!noSelectedItem){
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
}
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && ! getters.sharedDetail.protected
|
||||
? '/api/move/public' + router.currentRoute.params.token
|
||||
|
||||
31
resources/js/store/modules/userAuth.js
vendored
31
resources/js/store/modules/userAuth.js
vendored
@@ -48,13 +48,32 @@ const actions = {
|
||||
})
|
||||
},
|
||||
addToFavourites: (context, folder) => {
|
||||
let addFavourites = []
|
||||
let items = [folder]
|
||||
|
||||
console.log(context.getters.fileInfoDetail)
|
||||
if(!folder){
|
||||
items = context.getters.fileInfoDetail
|
||||
}
|
||||
|
||||
items.forEach((data) => {
|
||||
if(data.type === 'folder') {
|
||||
addFavourites.push({
|
||||
'unique_id': data.unique_id
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
if(!folder) {
|
||||
context.commit('CLEAR_FILEINFO_DETAIL')
|
||||
}
|
||||
|
||||
// Add to storage
|
||||
context.commit('ADD_TO_FAVOURITES', folder)
|
||||
context.commit('ADD_TO_FAVOURITES', items)
|
||||
|
||||
axios
|
||||
.post(context.getters.api + '/folders/favourites', {
|
||||
unique_id: folder.unique_id
|
||||
folders: addFavourites
|
||||
})
|
||||
.catch(() => {
|
||||
// Show error message
|
||||
@@ -95,11 +114,13 @@ const mutations = {
|
||||
state.app = undefined
|
||||
},
|
||||
ADD_TO_FAVOURITES(state, folder) {
|
||||
folder.forEach(item => {
|
||||
state.user.relationships.favourites.data.attributes.folders.push({
|
||||
unique_id: folder.unique_id,
|
||||
name: folder.name,
|
||||
type: folder.type,
|
||||
unique_id: item.unique_id,
|
||||
name: item.name,
|
||||
type: item.type,
|
||||
})
|
||||
})
|
||||
},
|
||||
UPDATE_NAME(state, name) {
|
||||
state.user.data.attributes.name = name
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
XIcon,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['user', 'homeDirectory', 'currentFolder', 'config']),
|
||||
...mapGetters(['user', 'homeDirectory', 'currentFolder', 'config', 'fileInfoDetail']),
|
||||
favourites() {
|
||||
return this.user.relationships.favourites.data.attributes.folders
|
||||
},
|
||||
@@ -132,6 +132,8 @@
|
||||
dragEnter() {
|
||||
if (this.draggedItem && this.draggedItem.type !== 'folder') return
|
||||
|
||||
if(this.fileInfoDetail.length > 0 && this.fileInfoDetail.find(item => item.type !== 'folder')) return
|
||||
|
||||
this.area = true
|
||||
},
|
||||
dragLeave() {
|
||||
@@ -146,8 +148,20 @@
|
||||
// Check if folder exist in favourites
|
||||
if (this.favourites.find(folder => folder.unique_id == this.draggedItem.unique_id)) return
|
||||
|
||||
// Prevent to move folders to self
|
||||
if(this.fileInfoDetail.length > 0 && this.fileInfoDetail.find(item => item.type !== 'folder')) return
|
||||
|
||||
// Store favourites folder
|
||||
|
||||
//Add to favourites non selected folder
|
||||
if(!this.fileInfoDetail.includes(this.draggedItem)){
|
||||
this.$store.dispatch('addToFavourites', this.draggedItem)
|
||||
}
|
||||
|
||||
//Add to favourites selected folders
|
||||
if(this.fileInfoDetail.includes(this.draggedItem)) {
|
||||
this.$store.dispatch('addToFavourites', null)
|
||||
}
|
||||
|
||||
},
|
||||
removeFavourite(folder) {
|
||||
|
||||
Reference in New Issue
Block a user