summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-13 09:33:57 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-13 09:33:57 +0200
commit6f45607f57c55550808824ffdeebbf10353a2554 (patch)
tree632299fe9ad96d6ef54001121a9bfaa61de1bc20 /apps/files/js
parent1f9e50086cc404d6dd46c5ae664f951faaf74c98 (diff)
downloadnextcloud-server-6f45607f57c55550808824ffdeebbf10353a2554.tar.gz
nextcloud-server-6f45607f57c55550808824ffdeebbf10353a2554.zip
Upgraded navigation submenu management and api + created sharing submenu
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/navigation.js26
1 files changed, 7 insertions, 19 deletions
diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js
index d4fa06cb45e..8ce976a6f53 100644
--- a/apps/files/js/navigation.js
+++ b/apps/files/js/navigation.js
@@ -172,30 +172,18 @@
*/
_onClickMenuButton: function (ev) {
var $target = $(ev.target);
+ var $menu = $target.parent('li');
var itemId = $target.closest('button').attr('id');
var collapsibleToggles = [];
var dotmenuToggles = [];
- // The collapsibleToggles-Array consists of a list of Arrays. Every subarray must contain the Button to listen to at the 0th index,
- // and the parent, which should be toggled at the first arrayindex.
- collapsibleToggles.push(["#button-collapse-favorites", "#button-collapse-parent-favorites"]);
-
- // The dotmenuToggles-Array consists of a list of Arrays. Every subarray must contain the Button to listen to at the 0th index,
- // and the parent, which should be toggled at the first arrayindex.
- dotmenuToggles.push(["#dotmenu-button-favorites", "dotmenu-content-favorites"]);
-
- collapsibleToggles.forEach(function foundToggle (item) {
- if (item[0] === ("#" + itemId)) {
- $(item[1]).toggleClass('open');
- var show = 1;
- if (!$(item[1]).hasClass('open')) {
- show = 0;
- }
- $.get(OC.generateUrl("/apps/files/api/v1/quickaccess/set/showList"), {show: show}, function (data, status) {
- });
- }
- });
+ if ($menu.hasClass('collapsible') && $menu.data('expandedstate')) {
+ $menu.toggleClass('open');
+ var show = $menu.hasClass('open') ? 1 : 0;
+ var key = $menu.data('expandedstate');
+ $.post(OC.generateUrl("/apps/files/api/v1/toggleShowFolder/" + key), {show: show});
+ }
dotmenuToggles.forEach(function foundToggle (item) {
if (item[0] === ("#" + itemId)) {