mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Lazyload: change skip_invisible option default to true
This commit is contained in:
parent
fe33ed9d60
commit
89e9eaa3c2
2
dist/js/widgets/widget-lazyload.min.js
vendored
2
dist/js/widgets/widget-lazyload.min.js
vendored
@ -1,5 +1,5 @@
|
||||
/*! Widget: lazyload (BETA) - 10/31/2015 (v2.24.0) */
|
||||
!function(a,b){"use strict";var c=a.tablesorter;c.lazyload={init:function(b,d){"scrollstop"!==d.lazyload_event||c.addScrollStopDone||(c.addScrollStop(),c.addScrollStopDone=!0,a.event.special.scrollstop.latency=d.lazyload_latency||250),c.lazyload.update(b,d);var e=[d.lazyload_update,"pagerUpdate",d.columnSelector_updated||"columnUpdate",""].join(b.namespace+"lazyload ");b.$table.on(e,function(){c.lazyload.update(b,b.widgetOptions)})},update:function(a,b){var c=(/(\.|#)/.test(b.lazyload_imageClass)?"":".")+b.lazyload_imageClass;a.$table.find(c).lazyload({threshold:b.lazyload_threshold,failure_limit:b.lazyload_failure_limit,event:b.lazyload_event,effect:b.lazyload_effect,container:b.lazyload_container,data_attribute:b.lazyload_data_attribute,skip_invisible:b.lazyload_skip_invisible,appear:b.lazyload_appear,load:b.lazyload_load,placeholder:b.lazyload_placeholder})},remove:function(a,b){a.$table.off(a.namespace+"lazyload")}},c.addWidget({id:"lazyload",options:{lazyload_imageClass:"lazy",lazyload_update:"lazyloadUpdate",lazyload_latency:250,lazyload_threshold:0,lazyload_failure_limit:0,lazyload_event:"scrollstop",lazyload_effect:"show",lazyload_container:b,lazyload_data_attribute:"original",lazyload_skip_invisible:!1,lazyload_appear:null,lazyload_load:null,lazyload_placeholder:"data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="},init:function(a,b,d,e){c.lazyload.init(d,e)},remove:function(a,b,d){c.lazyload.remove(b,d)}}),c.addScrollStop=function(){var b=a.event.dispatch||a.event.handle,c=a.event.special,d="D"+ +new Date,e="D"+(+new Date+1);c.scrollstart={setup:function(e){var f,g=a.extend({latency:c.scrollstop.latency},e),h=function(a){var c=this,d=arguments;f?clearTimeout(f):(a.type="scrollstart",b.apply(c,d)),f=setTimeout(function(){f=null},g.latency)};a(this).bind("scroll",h).data(d,h)},teardown:function(){a(this).unbind("scroll",a(this).data(d))}},c.scrollstop={latency:250,setup:function(d){var f,g=a.extend({latency:c.scrollstop.latency},d),h=function(a){var c=this,d=arguments;f&&clearTimeout(f),f=setTimeout(function(){f=null,a.type="scrollstop",b.apply(c,d)},g.latency)};a(this).bind("scroll",h).data(e,h)},teardown:function(){a(this).unbind("scroll",a(this).data(e))}}}}(jQuery,window),/*!
|
||||
!function(a,b){"use strict";var c=a.tablesorter;c.lazyload={init:function(d,e){"scrollstop"!==e.lazyload_event||c.addScrollStopDone||(c.addScrollStop(),c.addScrollStopDone=!0,a.event.special.scrollstop.latency=e.lazyload_latency||250),c.lazyload.update(d,e);var f=d.namespace+"lazyload ",g=[e.lazyload_update,"pagerUpdate",e.columnSelector_updated||"columnUpdate",""].join(f);d.$table.on(g,function(){c.lazyload.update(d,d.widgetOptions)}).on("filterEnd"+f,function(){a(b).scroll()})},update:function(a,b){var c=(/(\.|#)/.test(b.lazyload_imageClass)?"":".")+b.lazyload_imageClass;a.$table.find(c).lazyload({threshold:b.lazyload_threshold,failure_limit:b.lazyload_failure_limit,event:b.lazyload_event,effect:b.lazyload_effect,container:b.lazyload_container,data_attribute:b.lazyload_data_attribute,skip_invisible:b.lazyload_skip_invisible,appear:b.lazyload_appear,load:b.lazyload_load,placeholder:b.lazyload_placeholder})},remove:function(a,b){a.$table.off(a.namespace+"lazyload")}},c.addWidget({id:"lazyload",options:{lazyload_imageClass:"lazy",lazyload_update:"lazyloadUpdate",lazyload_latency:250,lazyload_threshold:0,lazyload_failure_limit:0,lazyload_event:"scrollstop",lazyload_effect:"show",lazyload_container:b,lazyload_data_attribute:"original",lazyload_skip_invisible:!0,lazyload_appear:null,lazyload_load:null,lazyload_placeholder:"data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="},init:function(a,b,d,e){c.lazyload.init(d,e)},remove:function(a,b,d){c.lazyload.remove(b,d)}}),c.addScrollStop=function(){var b=a.event.dispatch||a.event.handle,c=a.event.special,d="D"+ +new Date,e="D"+(+new Date+1);c.scrollstart={setup:function(e){var f,g=a.extend({latency:c.scrollstop.latency},e),h=function(a){var c=this,d=arguments;f?clearTimeout(f):(a.type="scrollstart",b.apply(c,d)),f=setTimeout(function(){f=null},g.latency)};a(this).bind("scroll",h).data(d,h)},teardown:function(){a(this).unbind("scroll",a(this).data(d))}},c.scrollstop={latency:250,setup:function(d){var f,g=a.extend({latency:c.scrollstop.latency},d),h=function(a){var c=this,d=arguments;f&&clearTimeout(f),f=setTimeout(function(){f=null,a.type="scrollstop",b.apply(c,d)},g.latency)};a(this).bind("scroll",h).data(e,h)},teardown:function(){a(this).unbind("scroll",a(this).data(e))}}}}(jQuery,window),/*!
|
||||
* Lazy Load - jQuery plugin for lazy loading images
|
||||
*
|
||||
* Copyright (c) 2007-2015 Mika Tuupola
|
||||
|
@ -17,12 +17,13 @@
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/theme.blue.css">
|
||||
<script src="../js/jquery.tablesorter.js"></script>
|
||||
<script src="../js/widgets/widget-filter.js"></script>
|
||||
<script src="../js/widgets/widget-lazyload.js"></script>
|
||||
|
||||
<script id="js">$(function() {
|
||||
$("table").tablesorter({
|
||||
theme : 'blue',
|
||||
widgets : [ 'lazyload', 'zebra' ],
|
||||
widgets : [ 'lazyload', 'filter', 'zebra' ],
|
||||
widgetOptions : {
|
||||
// widget options
|
||||
lazyload_imageClass : 'lazy',
|
||||
@ -35,7 +36,7 @@
|
||||
lazyload_effect : 'show',
|
||||
lazyload_container : window,
|
||||
lazyload_data_attribute : 'original',
|
||||
lazyload_skip_invisible : false,
|
||||
lazyload_skip_invisible : true,
|
||||
lazyload_appear : function( elements_left, settings ) {
|
||||
// callback fired when image is in view, but before it is loaded
|
||||
$(this).addClass( 'tablesorter-processing' );
|
||||
@ -238,10 +239,11 @@
|
||||
</tr>
|
||||
<tr id="lazyload_skip_invisible">
|
||||
<td><a href="#" class="permalink">lazyload_skip_invisible</a></td>
|
||||
<td><code>false</code></td>
|
||||
<td><code>true</code></td>
|
||||
<td>
|
||||
There are cases when you have images which are in viewport but not <code>:visible</code>.
|
||||
There are cases when you have images which are in viewport but not <code>:visible</code> (<span class="version updated">v2.25.6</span>).
|
||||
<div class="collapsible">
|
||||
<p>In <span class="version updated">v2.25.6</span>, change this default value to <code>true</code> to better work with the filter widget.</p>
|
||||
<p>To improve performance you can ignore <code>.not(":visible")</code> images by setting this option to <code>true</code>.</p>
|
||||
For more details, see the <a class="external" href="http://www.appelsiini.net/projects/lazyload#dealing-with-invisible-images">main documentation</a>.
|
||||
</div>
|
||||
|
@ -480,7 +480,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="example-widget-header-titles.html">Header titles widget</a> (v2.15.6; <span class="version updated">v2.24.4</span>).</li>
|
||||
<li><span class="label label-info">Beta</span> <a href="example-widget-lazyload.html">Lazyload widget</a> (<span class="version">v2.24.0</span>).</li>
|
||||
<li><span class="label label-info">Beta</span> <a href="example-widget-lazyload.html">Lazyload widget</a> (<span class="version">v2.24.0</span>; <span class="version updated">v2.25.6</span>).</li>
|
||||
<li><a href="example-widget-math.html">Math widget</a> (<span class="version">v2.16</span>; <span class="version updated">v2.25.5</span>).</li>
|
||||
<li>
|
||||
<a href="example-widget-output.html">Output widget</a> (<span class="version">v2.16</span>; <span class="version updated">v2.25.2</span>).
|
||||
|
@ -63,7 +63,7 @@
|
||||
lazyload_effect : 'show',
|
||||
lazyload_container : window,
|
||||
lazyload_data_attribute : 'original',
|
||||
lazyload_skip_invisible : false,
|
||||
lazyload_skip_invisible : true,
|
||||
lazyload_appear : null,
|
||||
lazyload_load : null,
|
||||
lazyload_placeholder : 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='
|
||||
|
Loading…
Reference in New Issue
Block a user