From 0798359a3a908f443e8d79da7dc852eb6d5382de Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 13 Mar 2018 14:58:24 +0100 Subject: [usb-lock-off] drag n drop now with color to show where the item will be droped --- modules-available/usblockoff/templates/usb-edit-config.html | 2 +- modules-available/usblockoff/templates/usb-rules-config.html | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'modules-available') diff --git a/modules-available/usblockoff/templates/usb-edit-config.html b/modules-available/usblockoff/templates/usb-edit-config.html index 67ccc06b..694101d4 100644 --- a/modules-available/usblockoff/templates/usb-edit-config.html +++ b/modules-available/usblockoff/templates/usb-edit-config.html @@ -11,7 +11,7 @@
- +
diff --git a/modules-available/usblockoff/templates/usb-rules-config.html b/modules-available/usblockoff/templates/usb-rules-config.html index 712eb2ab..e69c6fd9 100644 --- a/modules-available/usblockoff/templates/usb-rules-config.html +++ b/modules-available/usblockoff/templates/usb-rules-config.html @@ -79,10 +79,13 @@ handle: '.drag-handler', start: function(evt, ui) { oldIndex = ui.item.index(); + ui.placeholder.css("visibility", "visible"); + ui.placeholder.css("opacity", "0.152"); + ui.placeholder.css("background-color", "LawnGreen"); }, stop: function(evt, ui) { updateTable(ui.item.index()); - }, + } }); $('a.overload').tooltip({placement: "auto", html: true}); @@ -92,7 +95,7 @@ // Called after a drag & drop event is finished. function updateTable(new_index) { var old_i = -1; - if (oldIndex == -1) { + if (oldIndex === -1) { return; } else { old_i = oldIndex; @@ -101,7 +104,6 @@ var rule = rules[old_i]; rules.splice(old_i, 1); rules.splice(new_index, 0, rule); - console.log(JSON.stringify(rules)); $('#rules').val(JSON.stringify(rules)); } \ No newline at end of file -- cgit v1.2.3-55-g7522