When a popup announcement is displayed on a smaller device, it is possible for the popup to be larger than then screen, making popup content illegible.

The width of the popup is set using inline style, so cannot be overriden by theme css (except by using !Important).

This patch checks the configured width before applying (js).

Comments

autopoietic created an issue. See original summary.

autopoietic’s picture

Issue summary: View changes
StatusFileSize
new630 bytes
autopoietic’s picture

Assigned: autopoietic » Unassigned
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: popup_announcement-mobile_width-2621470-1-D7.patch, failed testing.

sergey-serov’s picture

Good Evening, Tom Readings.
Thank You for Your patch.

autopoietic’s picture

Status: Needs work » Needs review
StatusFileSize
new630 bytes

Hello Sergey. First patch failed, recreated.

Status: Needs review » Needs work

The last submitted patch, 6: popup_announcement-mobile_width-2621470-1-D7.patch, failed testing.

autopoietic’s picture

Not certain why these patches fail on d.o, they run fine locally. Only a simple amendment, for second patch followed 'quick and simple patch' instructions.

sergey-serov’s picture

Maybe it is automatically applying for dev-version?

In log:
fatal: git diff header lacks filename information when removing 1 leading pathname components (line 5)

And
Output: [6c1d364 Reafctoring module before adding new functionality. Docs improvement. New tasks were added.].
This is my commit comment for development version of module.

autopoietic’s picture

I did create the patch against 7.x-1.x, should I have used 7.x-1.3 instead?

My understanding was that patches should be supplied for the dev branch of a contrib module.

danisadr’s picture

Hi:

I have doning my own test for this module. I solved the problem, more or less, add this:

+ if($(document).width() > 480) {
          announcement.show().css({
            'width': Drupal.settings.popup_announcement.width,
            'height': Drupal.settings.popup_announcement.height,
            'left': left,
            'top': top
          });
+        } else {
+          announcement.show().css({
+           'width': 320,
+            'height': 320,
+           'left': 0,
+            'top': top
+          });
+       }

I think this solution is not the cleanest but I'd like a remedy if you can see some similar option.