From 6fbe70eeaf989aea184684ff18c5062769b8943d Mon Sep 17 00:00:00 2001 From: sk-ys Date: Sun, 3 Nov 2024 21:52:00 +0000 Subject: [PATCH] Make the notice bar draggable --- .../layouts/_compact_notice_bar.html.erb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/views/enhanced_ux/layouts/_compact_notice_bar.html.erb b/app/views/enhanced_ux/layouts/_compact_notice_bar.html.erb index 4f813e5..a216d71 100644 --- a/app/views/enhanced_ux/layouts/_compact_notice_bar.html.erb +++ b/app/views/enhanced_ux/layouts/_compact_notice_bar.html.erb @@ -89,6 +89,17 @@ addCloseButton(e); setFadeOutEvent(e); + $(e).draggable({ + create: function () { + // Remove the position style set by jQuery UI + $(e).css("position", ""); + }, + start: function (ev) { + if (isMobile()) { + ev.preventDefault(); + } + }, + }); }); } @@ -156,6 +167,11 @@ left: 20px; box-sizing: border-box; z-index: 300; + cursor: grab; + + &:active { + cursor: grabbing; + } } }