Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1901 from vogdb/issue-1901
Browse files Browse the repository at this point in the history
Breaking: Fix contentPlaceholder options construction.
  • Loading branch information
vogdb committed Sep 10, 2015
2 parents 65b0343 + 869bd12 commit 742be7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
* @param {Object} [lazyLoadOptions] options to lazy-load-images plugin.
* @returns {jQuery}
*/
$.fn.contentPlaceholder = function(lazyLoadOptions) {
$.fn.lazyImageSetup = function(lazyLoadOptions) {
return this.each(function() {
var options = _.defaults(lazyLoadOptions, {
var options = _.defaults(lazyLoadOptions || {}, {
threshold: 600,
failure_limit: 10
});
var self = this;
$(this).find('img.lazy').lazyload(options);
var $this = $(this);
if ($this.hasClass('scrollable')) {
options.container = $this;
}
$this.find('img.lazy').lazyload(options);
});
};

Expand Down
4 changes: 2 additions & 2 deletions library/CM/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ var CM_App = CM_Class_Abstract.extend({
$doNotLoadOnReady = $doNotLoadOnReady.add($notFirstImages);

$(this).on('toggle.clipSlide', function() {
$(this).find('.contentPlaceholder:gt(0)').contentPlaceholder();
$(this).find('.contentPlaceholder:gt(0)').lazyImageSetup();
});
});

$dom.find('.contentPlaceholder').not($doNotLoadOnReady).contentPlaceholder();
$dom.find('.contentPlaceholder').not($doNotLoadOnReady).lazyImageSetup();
},

/**
Expand Down

0 comments on commit 742be7d

Please sign in to comment.