Fixed Lightbox defaults not used because of type

digitalpoint

Well-known member
Affected version
2.2.7
Been trying to figure out why XF's lightbox doesn't display thumbnails by default even though the default in XF.Lightbox is options.lbThumbsAuto = 1, nor could I get it to work as expected when you override the defaults.

Long story short is Fancybox doesn't coerce that option.

From jquery.fancybox.js:
JavaScript:
if (Thumbs.isActive && Thumbs.opts.autoStart === true) {
  Thumbs.show();
}

Might be worth it to cast the setting before it gets passed along to Fancybox.
JavaScript:
thumbs: {
   autoStart: !!this.options.lbThumbsAuto,
   axis: 'x'
}

TL;DR - Overriding the default "1" to "true" makes it work as expected.
 
Last edited:

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.8).

Change log:
coerce the lbThumbsAuto option value to a boolean to ensure it works as expected.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top