From 1a4974b7df9be01816d52190ecd2dfbc18cbc9c9 Mon Sep 17 00:00:00 2001 From: stepie22 Date: Tue, 18 Oct 2016 23:53:39 +0200 Subject: [PATCH] Fix channels drag'n'droping --- client/css/style.css | 1 + client/js/lounge.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/css/style.css b/client/css/style.css index 761b6f57..8cc68849 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -409,6 +409,7 @@ button { text-align: left; transition: color .2s; width: 180px; + left: auto !important; /* Fix for drag'n'drop not recalculating left position */ } #sidebar .chan-placeholder { diff --git a/client/js/lounge.js b/client/js/lounge.js index df949240..9769efd2 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -1245,15 +1245,17 @@ $(function() { } function sortable() { - sidebar.sortable({ + sidebar.find(".networks").sortable({ axis: "y", containment: "parent", - cursor: "grabbing", + cursor: "move", distance: 12, items: ".network", handle: ".lobby", placeholder: "network-placeholder", forcePlaceholderSize: true, + tolerance: "pointer", // Use the pointer to figure out where the network is in the list + update: function() { var order = []; sidebar.find(".network").each(function() { @@ -1271,11 +1273,13 @@ $(function() { sidebar.find(".network").sortable({ axis: "y", containment: "parent", - cursor: "grabbing", + cursor: "move", distance: 12, items: ".chan:not(.lobby)", placeholder: "chan-placeholder", forcePlaceholderSize: true, + tolerance: "pointer", // Use the pointer to figure out where the channel is in the list + update: function(e, ui) { var order = []; var network = ui.item.parent();