Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have a client who would like to be able to provide a different popup message for mobile devices.
I'll upload a patch which provides this feature shortly.
Comment | File | Size | Author |
---|---|---|---|
#7 | eu_cookie_compliance-alternate-message-for-mobile-2921182-7.patch | 8.37 KB | svenryen |
Comments
Comment #2
LNakamura CreditAttribution: LNakamura at Mediacurrent commentedComment #3
shrop CreditAttribution: shrop at Mediacurrent commentedConsider adding configuration to adjust the max-width px setting in JS so it doesn't have to be hardcoded. I bet someone here can confirm if that makes sense and patch it up.
Comment #4
LNakamura CreditAttribution: LNakamura at Mediacurrent commentedFixed a bug (new message wasn't being saved on config save), and changed the max-width to 600px in the JS, which matches the media query in eu_cookie_compliance.css.
Comment #5
LNakamura CreditAttribution: LNakamura at Mediacurrent commentedThanks, @shrop - another option would be to follow what's outlined here: https://www.lullabot.com/articles/importing-css-breakpoints-into-javascript
Comment #6
LNakamura CreditAttribution: LNakamura at Mediacurrent commentedComment #7
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedHere's an improved patch that allows the user to input the mobile breakpoint. 600 makes little sense, so I adjusted it to 768 px. It's debatable whether the css also should have 768 as the breakpoint.
I also tidied up the admin form, so that the option is exposed only when clicking a checkbox.
Comment #9
svenryen CreditAttribution: svenryen at Ramsalt Lab commented