christianwach / civicrm-admin-utilities

CiviCRM Admin Utilities is a WordPress plugin that modifies and enhances CiviCRM's appearance and behaviour in single site and multisite WordPress installs.
https://wordpress.org/plugins/civicrm-admin-utilities/
GNU General Public License v2.0
20 stars 10 forks source link

Modify Wordpress viewport to better support sticky headers and CiviCRM headers #39

Open shaneonabike opened 3 months ago

shaneonabike commented 3 months ago

Issue

While working on adding the sticky headers functionality I couldn't figure out why they were not working on mobile. Then I came across this stackoverflow which apparently is due to the viewport settings for the page.

Proposed solution

I don't know if you think it would be relevant to this plugin, but I think it would be a good addition to add the viewport modification in Wordpress so that everyone could benefit. After enabling this in a custom plugin I could see that the toolbar remains at the top, and the sticky headers addition I'm adding suddenly works.

Code needed

function my_meta_viewport() {
  return 'height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0, target-densitydpi=device-dpi';
}
add_action( 'admin_viewport_meta', 'my_meta_viewport' );

Let me know if you want me to make a merge request which I'm more than happy to do!

christianwach commented 2 months ago

@shaneonabike Sorry I missed this. This would need to be more specifically targeted to screens that need it - or else people might find all sorts of oddities in their WordPress installs. I'm going to rework the whole Radstock theme and drop support for ancient versions of CiviCRM so I'll have a deeper look then.

shaneonabike commented 2 months ago

It's ok I'm sure you have been busy since you got back @christianwach

How would this affect all the admin. From what I understood (I'm no expert of viewports) this simply fixes the viewport a bit more to allow for better scaling. What kind of oddities are you thinking of? Just so I might be able to find a better solution even for our own stack.