|
1 | 1 | // ================================================== |
2 | | -// fancyBox v3.1.25 |
| 2 | +// fancyBox v3.1.26 |
3 | 3 | // |
4 | 4 | // Licensed GPLv3 for open source use |
5 | 5 | // or fancyBox Commercial License for commercial use |
|
36 | 36 | // Enable infinite gallery navigation |
37 | 37 | loop : false, |
38 | 38 |
|
39 | | - // Space around image, ignored if zoomed-in or viewport smaller than 800px |
| 39 | + // Space around image, ignored if zoomed-in or viewport width is smaller than 800px |
40 | 40 | margin : [44, 0], |
41 | 41 |
|
42 | 42 | // Horizontal space between slides |
|
227 | 227 | autoStart : false, |
228 | 228 | }, |
229 | 229 |
|
| 230 | + // Set `touch: false` to disable dragging/swiping |
230 | 231 | touch : { |
231 | 232 | vertical : true, // Allow to drag content vertically |
232 | 233 | momentum : true // Continue movement after releasing mouse/touch when panning |
|
325 | 326 | return current.type === 'image' ? 'toggleControls' : false; |
326 | 327 | }, |
327 | 328 | clickSlide : function( current, event ) { |
328 | | - return current.type === 'image' ? 'toggleControls' : "close"; |
| 329 | + return current.type === 'image' ? 'toggleControls' : 'close'; |
329 | 330 | }, |
330 | 331 | dblclickContent : function( current, event ) { |
331 | 332 | return current.type === 'image' ? 'zoom' : false; |
|
1816 | 1817 |
|
1817 | 1818 | $slide.on('refresh.fb', function() { |
1818 | 1819 | var $wrap = slide.$content, |
1819 | | - $contents, |
1820 | | - $body, |
| 1820 | + frameWidth = opts.css.width, |
| 1821 | + frameHeight = opts.css.height, |
1821 | 1822 | scrollWidth, |
1822 | | - frameWidth, |
1823 | | - frameHeight; |
| 1823 | + $contents, |
| 1824 | + $body; |
1824 | 1825 |
|
1825 | 1826 | if ( $iframe[0].isReady !== 1 ) { |
1826 | 1827 | return; |
|
1836 | 1837 | } catch (ignore) {} |
1837 | 1838 |
|
1838 | 1839 | // Calculate dimensions for the wrapper |
1839 | | - if ( $body && $body.length && !( opts.css.width !== undefined && opts.css.height !== undefined ) ) { |
| 1840 | + if ( $body && $body.length ) { |
1840 | 1841 |
|
1841 | | - scrollWidth = $iframe[0].contentWindow.document.documentElement.scrollWidth; |
| 1842 | + if ( frameWidth === undefined ) { |
| 1843 | + scrollWidth = $iframe[0].contentWindow.document.documentElement.scrollWidth; |
1842 | 1844 |
|
1843 | | - frameWidth = Math.ceil( $body.outerWidth(true) + ( $wrap.width() - scrollWidth ) ); |
1844 | | - frameHeight = Math.ceil( $body.outerHeight(true) ); |
| 1845 | + frameWidth = Math.ceil( $body.outerWidth(true) + ( $wrap.width() - scrollWidth ) ); |
| 1846 | + frameWidth += $wrap.outerWidth() - $wrap.innerWidth(); |
| 1847 | + } |
| 1848 | + |
| 1849 | + if ( frameHeight === undefined ) { |
| 1850 | + frameHeight = Math.ceil( $body.outerHeight(true) ); |
| 1851 | + frameHeight += $wrap.outerHeight() - $wrap.innerHeight(); |
| 1852 | + } |
1845 | 1853 |
|
1846 | 1854 | // Resize wrapper to fit iframe content |
1847 | | - $wrap.css({ |
1848 | | - 'width' : opts.css.width === undefined ? frameWidth + ( $wrap.outerWidth() - $wrap.innerWidth() ) : opts.css.width, |
1849 | | - 'height' : opts.css.height === undefined ? frameHeight + ( $wrap.outerHeight() - $wrap.innerHeight() ) : opts.css.height |
1850 | | - }); |
| 1855 | + if ( frameWidth ) { |
| 1856 | + $wrap.width( frameWidth ); |
| 1857 | + } |
1851 | 1858 |
|
| 1859 | + if ( frameHeight ) { |
| 1860 | + $wrap.height( frameHeight ); |
| 1861 | + } |
1852 | 1862 | } |
1853 | 1863 |
|
1854 | 1864 | $wrap.removeClass( 'fancybox-is-hidden' ); |
|
2256 | 2266 |
|
2257 | 2267 | $.fancybox.stop( slide.$slide ); |
2258 | 2268 |
|
2259 | | - slide.$slide.unbind().remove(); |
| 2269 | + slide.$slide.off().remove(); |
2260 | 2270 | } |
2261 | 2271 | }); |
2262 | 2272 |
|
|
2310 | 2320 | return; |
2311 | 2321 | } |
2312 | 2322 |
|
2313 | | - // Skip for images and iframes |
2314 | | - $el = current && current.isComplete ? current.$slide.find('button,:input,[tabindex],a').filter(':not([disabled]):visible:first') : null; |
| 2323 | + if ( current && current.isComplete ) { |
| 2324 | + |
| 2325 | + // Look for first input with autofocus attribute |
| 2326 | + $el = current.$slide.find('input[autofocus]:enabled:visible:first'); |
| 2327 | + |
| 2328 | + if ( !$el.length ) { |
| 2329 | + $el = current.$slide.find('button,:input,[tabindex],a').filter(':enabled:visible:first'); |
| 2330 | + } |
| 2331 | + } |
| 2332 | + |
2315 | 2333 | $el = $el && $el.length ? $el : this.$refs.container; |
2316 | 2334 |
|
2317 | 2335 | $el.focus(); |
|
2495 | 2513 | instance.activate(); |
2496 | 2514 |
|
2497 | 2515 | } else { |
2498 | | - |
2499 | 2516 | $W.scrollTop( self.scrollTop ).scrollLeft( self.scrollLeft ); |
2500 | 2517 |
|
2501 | 2518 | $( 'html' ).removeClass( 'fancybox-enabled' ); |
|
2629 | 2646 |
|
2630 | 2647 | $.fancybox = { |
2631 | 2648 |
|
2632 | | - version : "3.1.25", |
| 2649 | + version : "3.1.26", |
2633 | 2650 | defaults : defaults, |
2634 | 2651 |
|
2635 | 2652 |
|
|
3265 | 3282 |
|
3266 | 3283 | var isClickable = function( $el ) { |
3267 | 3284 |
|
3268 | | - if ( $el.is('a,button,input,select,textarea') || $.isFunction( $el.get(0).onclick ) || $el.data('selectable') ) { |
| 3285 | + if ( $el.is('a,button,input,select,textarea,label') || $.isFunction( $el.get(0).onclick ) || $el.data('selectable') ) { |
3269 | 3286 | return true; |
3270 | 3287 | } |
3271 | 3288 |
|
|
0 commit comments