Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
FIX for #49: Ensuring unassociated <video> elements are not reloaded …
…even though they may already be visible and/or are not loaded lazily.
  • Loading branch information
patricknelson committed Aug 11, 2015
commit 41b6eeac516086694ee5a5e6e4052c516c677931
3 changes: 3 additions & 0 deletions dist/jquery.lazyloadxt.extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
* @param {jQuery} $el
*/
function triggerEvent(event, $el) {
// Don't bother triggering events on elements that we're not keeping track of.
if ($.inArray($el, elements) === -1) return;

var handler = options['on' + event];
if (handler) {
if ($isFunction(handler)) {
Expand Down
3 changes: 3 additions & 0 deletions dist/jquery.lazyloadxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
* @param {jQuery} $el
*/
function triggerEvent(event, $el) {
// Don't bother triggering events on elements that we're not keeping track of.
if ($.inArray($el, elements) === -1) return;

var handler = options['on' + event];
if (handler) {
if ($isFunction(handler)) {
Expand Down
3 changes: 3 additions & 0 deletions src/jquery.lazyloadxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
* @param {jQuery} $el
*/
function triggerEvent(event, $el) {
// Don't bother triggering events on elements that we're not keeping track of.
if ($.inArray($el, elements) === -1) return;

var handler = options['on' + event];
if (handler) {
if ($isFunction(handler)) {
Expand Down