Cannot reproduce js OverlayTrigger ignoring options

Xon

Well-known member
The XenForo OverlayTrigger js object appears to ignore it's options parameter. At least in IE11.

I was trying to supress the mask that is applied when an overlay is triggered with:
Code:
                  $overlay = new XenForo.OverlayTrigger($trigger,
                  {
                    mask: false,
                  });

But this would fail, the following works (empty options or not);
Code:
                  $trigger.data('overlayoptions', {
                    mask: false,
                  });
                  $overlay = new XenForo.OverlayTrigger($trigger,
                  {
                    mask: false,
                  });
 
I can't reproduce this (even in IE11). My test code was:
Code:
var $a = $('a[href="forums/main-forum.2/"]');
new XenForo.OverlayTrigger($a);
//new XenForo.OverlayTrigger($a, { mask: false });
Then clicking the link in question (which is only triggering an overlay by virtue of this code; it's just a link into a forum from the forum list). The mask is controlled as I would expect between the two lines.

If you're applying this to something that is already an OverlayTrigger, then it's very likely that code is running and thus creating the mask. That would explain why the overlayoptions approach works.
 
Back
Top Bottom