Skip to content

Commit 201b33b

Browse files
committed
Pin action buttons to the viewport while a wide table scrolls
On a wide index table the whole page scrolls horizontally, which carried the action items (New X, filters, etc.) off to the right with it. Make #titlebar_right position:sticky so the buttons stay pinned to the right of the viewport while the table scrolls underneath — matching the sticky header. Consuming apps each shipped this as a local scroll_buttons_init.scss; it lives in the theme now so every app behaves the same.
1 parent e93a418 commit 201b33b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎app/assets/stylesheets/wigu/active_admin_theme.scss‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,13 @@ body.active_admin {
672672
}
673673
}
674674
#titlebar_right {
675+
// Sticky action buttons: on a wide index table the whole page scrolls
676+
// horizontally, so pin the action items to the right of the viewport —
677+
// the page scrolls, the buttons stay put. Each app used to carry this as a
678+
// local scroll_buttons_init.scss; it lives in the theme now.
679+
position: sticky;
680+
right: 15px;
681+
float: right;
675682
// `> a` and `> .dropdown_menu > a`: an action item may hold a dropdown, and
676683
// a descendant selector here paints its menu entries with the button fill
677684
// too — with !important, so the entry rules below cannot undo it.

0 commit comments

Comments
 (0)