diff options
author | fnuesse <felix.nuesse@t-online.de> | 2018-06-27 00:35:28 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-12 16:49:38 +0200 |
commit | 55ebdc9344dc8edb665491bf89595f406cfc4d62 (patch) | |
tree | 23bdc47aea07adf307dc70718d427acb17eb3e92 /apps/files/js/navigation.js | |
parent | 9b914bd68dc53d5fe5ac98e9bbeb3b8da436096e (diff) | |
download | nextcloud-server-55ebdc9344dc8edb665491bf89595f406cfc4d62.tar.gz nextcloud-server-55ebdc9344dc8edb665491bf89595f406cfc4d62.zip |
Fix collapsible-Button when list was emptied (or got first element)
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Fixed Bad url-generation in javascript for new quickaccessitems
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Fixed vertical scrolling in sortable-list which leads to "hidden" navbar
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Removed unnessessary console logs
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Fixed Bounds in custom sorting
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Reformatted code
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Fixed horizontalscroll on sortable-list
Fixed "stuck element" where you could not switch back to the original ordering in the sortable-list
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Diffstat (limited to 'apps/files/js/navigation.js')
-rw-r--r-- | apps/files/js/navigation.js | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js index b83cd82128c..799e265bdff 100644 --- a/apps/files/js/navigation.js +++ b/apps/files/js/navigation.js @@ -163,9 +163,25 @@ */ _setOnDrag: function () { var scope=this; + var element = $("#sublist-favorites"); $(function () { if (document.getElementById(scope.$quickAccessListKey.toString()).hasAttribute("draggable")) { - $("#sublist-favorites").sortable({ + element.sortable({ + axis: "y", + containment: "parent", + scroll: false, + zIndex: 0, + opacity: 0.5, + delay: 150, + tolerance: "pointer", + start:function(event, ui){ + //Fix for offset + ui.helper[0].style.left ='0px'; + }, + stop: function( event, ui ) { + //Clean up offset + ui.item.removeAttr("style"); + }, update: function (event, ui) { var list = document.getElementById(scope.$quickAccessListKey.toString()).getElementsByTagName('li'); var string=[]; @@ -174,7 +190,6 @@ string.push(Object); } var resultorder=JSON.stringify(string); - console.log(resultorder); $.get(OC.generateUrl("/apps/files/api/v1/quickaccess/set/CustomSortingOrder"),{ order: resultorder}, function (data, status) {}); } @@ -262,9 +277,7 @@ } else if (this.$sortingStrategy === 'customorder') { var scope = this; $.get(OC.generateUrl("/apps/files/api/v1/quickaccess/get/CustomSortingOrder"), function (data, status) { - console.log("load order:"); - var ordering=JSON.parse(data) - console.log(ordering); + var ordering=JSON.parse(data); for (var i = 0; i < ordering.length; i++) { for (var j = 0; j < list.length; j++) { if (scope.getCompareValue(list, j, 'alphabet').toLowerCase() === ordering[i].name.toLowerCase()) { @@ -341,7 +354,7 @@ if (strategy === 'alphabet') { return nodes[int].getElementsByTagName('a')[0].innerHTML.toLowerCase(); } else if (strategy === 'date') { - return nodes[int].getAttribute('folderPos').toLowerCase(); + return nodes[int].getAttribute('folderPosition').toLowerCase(); } else if (strategy === 'datemodified') { return nodes[int].getAttribute('mtime'); }else if (strategy === 'customorder') { |