From c5569ea30f53983e27677887b6781220fafc606c Mon Sep 17 00:00:00 2001 From: Joe Ma Date: Sun, 4 Feb 2024 22:46:11 +0800 Subject: [PATCH] Update paste modal sizing and scrolling Signed-off-by: Joe Ma --- frontend/paste.html | 10 +++++----- frontend/static/paste.css | 16 ++++++++++++++++ frontend/static/paste.js | 9 +++------ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/frontend/paste.html b/frontend/paste.html index 75ca7d8..c644535 100644 --- a/frontend/paste.html +++ b/frontend/paste.html @@ -217,10 +217,10 @@ -
- +
+
- + @@ -247,11 +247,11 @@ - + - +
Paste information
Paste ID -
Created--
Expired--
diff --git a/frontend/static/paste.css b/frontend/static/paste.css index c4c4713..91e4ada 100644 --- a/frontend/static/paste.css +++ b/frontend/static/paste.css @@ -22,4 +22,20 @@ .card-header .collapsed .fa-chevron-down { transform: rotate(90deg); +} + +#paste_info_table td.col-6 { + max-width: 200px; +} + +#paste_info_title { + overflow: scroll; + white-space: nowrap; + scrollbar-width: none; /* Firefox */ +} + +#paste_info_title::-webkit-scrollbar { + width: 0px; + height: 0px; + background: transparent; } \ No newline at end of file diff --git a/frontend/static/paste.js b/frontend/static/paste.js index 837a8be..1534f3e 100644 --- a/frontend/static/paste.js +++ b/frontend/static/paste.js @@ -113,6 +113,7 @@ function build_paste_modal(paste_info, show_qrcode = true, saved = true, build_o let modal = new bootstrap.Modal(paste_modal.modal); if (!build_only) modal.show(); + $('.modal-body').scrollTop('0'); } /** @@ -376,7 +377,7 @@ $(function () { } try { - const res = await fetch(`${ENDPOINT}/${uuid}/settings?${new URLSearchParams({ json: '1' })}`); + const res = await fetch(`https://pb.nekoid.cc/${uuid}/settings?${new URLSearchParams({ json: '1' })}`); if (res.ok) { const paste_info = await res.json(); build_paste_modal(paste_info, show_qrcode, false); @@ -401,11 +402,7 @@ $(function () { paste_modal.id_copy_btn.removeClass('btn-primary'); paste_modal.id_copy_btn.addClass('btn-success'); tooltip.setContent({ '.tooltip-inner': 'Copied' }); - } catch (err) { - tooltip.setContent({ '.tooltip-inner': 'Copied failed' }); - } - } else { - tooltip.setContent({ '.tooltip-inner': 'Copied failed' }); + } catch (err) {} } });