summaryrefslogtreecommitdiffhomepage
path: root/themes/luci-theme-openwrt
diff options
context:
space:
mode:
authorRamon Van Gorkom <Ramon00c00@gmail.com>2024-11-21 21:34:14 +0100
committerPaul Donald <newtwen+github@gmail.com>2024-11-27 21:43:16 +0100
commit80f18df48fcc39d22dfabb133e9bc823d7aeff86 (patch)
treead2c055a0340c4b35aa61bf0b4261b86f315f0e6 /themes/luci-theme-openwrt
parentfefb9acf57ad11012c336e4d056b074620b87d2f (diff)
luci-base: make items of UIDynamicList drag-sortable
Signed-off-by: Ramon Van Gorkom <Ramon00c00@gmail.com>
Diffstat (limited to 'themes/luci-theme-openwrt')
-rw-r--r--themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css29
1 files changed, 28 insertions, 1 deletions
diff --git a/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css b/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css
index 6ef9d63e72..2e7ba94aef 100644
--- a/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css
+++ b/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css
@@ -1340,10 +1340,12 @@ ul.cbi-tabmenu li.cbi-tab-disabled[data-errors]::after {
border: 1px outset #000;
border-radius: 3px;
position: relative;
- pointer-events: none;
+ pointer-events: auto; /* needed for drag-and-drop in UIDynamicList */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
+ cursor: move; /* drag-and-drop */
+ user-select: text; /* text selection in drag-and-drop */
}
.cbi-dynlist > .item::after {
@@ -1364,10 +1366,35 @@ ul.cbi-tabmenu li.cbi-tab-disabled[data-errors]::after {
height: auto;
}
+/* indication line for drag-and-drop in UIDynamicList*/
+.cbi-dynlist > .item.drag-over {
+ border-top: 1px solid red;
+}
+
+/* Make item being dragged in UIDynamicList partially transparent*/
+.cbi-dynlist > .item.dragging {
+ opacity: 0.5;
+}
+
+/* prevent pointer changing when over the span element in UIDynamicList */
+.cbi-dynlist > .item > span {
+ pointer-events: none;
+}
+
.cbi-dynlist > .add-item {
display: flex;
}
+/* indication line for drag-and-drop in UIDynamicList*/
+.cbi-dynlist > .add-item > .cbi-input-text.drag-over {
+ border-top: 1px solid re;
+}
+
+/* indication line for drag-and-drop in UIDynamicList*/
+.cbi-dynlist > .add-item > .cbi-button-add.drag-over {
+ border-top: 1px solid red;
+}
+
.cbi-dynlist > .add-item > input {
flex: 1 1 auto;
}