mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-11-17 19:20:36 -05:00
Keep item suggestions on screen and stop the page sliding sideways on phones
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3725f27d05
commit
6f459c7016
2 files changed
+22
-1
No files matched your search
@@ -10,6 +10,10 @@
|
|||||||
let ac = $(this).autocomplete({
|
let ac = $(this).autocomplete({
|
||||||
appendTo: "body",
|
appendTo: "body",
|
||||||
minLength: 2,
|
minLength: 2,
|
||||||
|
// Kept on screen: on a phone a wide list of suggestions widened the page, which could leave the page
|
||||||
|
// stuck scrolled to the side
|
||||||
|
classes: { "ui-autocomplete": "line-item-suggestions" },
|
||||||
|
position: { my: "left top", at: "left bottom", collision: "flipfit" },
|
||||||
|
|
||||||
source: function(request, response) {
|
source: function(request, response) {
|
||||||
$.getJSON("/items/autocomplete", { q: request.term })
|
$.getJSON("/items/autocomplete", { q: request.term })
|
||||||
|
|||||||
@@ -244,7 +244,17 @@ table.list.line-items-table td:nth-child(n+2) {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Item suggestions */
|
/* Item suggestions: no wider than the screen, long descriptions wrap */
|
||||||
|
.ui-autocomplete.line-item-suggestions {
|
||||||
|
max-width: calc(100vw - 16px);
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-item-suggestions .autocomplete-item {
|
||||||
|
white-space: normal;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
.autocomplete-item {
|
.autocomplete-item {
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
@@ -263,6 +273,13 @@ table.list.line-items-table td:nth-child(n+2) {
|
|||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Phones and narrow windows: Redmine's page wrapper hides what sticks out sideways but can still be scrolled
|
||||||
|
sideways by the browser (bringing a field or list into view), with no way to swipe it back. Clipping
|
||||||
|
instead keeps it in place. */
|
||||||
|
@media screen and (max-width: 899px) {
|
||||||
|
#wrapper { overflow-x: clip; }
|
||||||
|
}
|
||||||
|
|
||||||
/* Phones: each line becomes a small card (number, description and delete; quantity, price and total) */
|
/* Phones: each line becomes a small card (number, description and delete; quantity, price and total) */
|
||||||
@media screen and (max-width: 699px) {
|
@media screen and (max-width: 699px) {
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user