Skip to content

Commit

Permalink
Merge 6b8cc43 into 5f47799
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Jul 25, 2016
2 parents 5f47799 + 6b8cc43 commit 5a17bcd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Expand Up @@ -6,7 +6,8 @@ There's a frood who really knows where his towel is.
1.0rc1 (unreleased)
-------------------

- Nothing changed yet.
- Use <img> attributes to get image height (fix use with collective.lazysizes).
[rodfersou]


1.0b2 (2016-07-20)
Expand Down
10 changes: 5 additions & 5 deletions src/collective/js/cycle2/resources/utils.js
Expand Up @@ -43,12 +43,12 @@
};
Cycle2SlideShow.prototype.centerImage = function(img) {
if (typeof(img) === 'undefined') {
var img = this.$imgs[0].parentElement;
if ($(img).hasClass('cycle-sentinel')) {
img = this.$imgs[1].parentElement;
var img = this.$imgs[0];
if ($(img).parent().hasClass('cycle-sentinel')) {
img = this.$imgs[1];
}
}
var img_height = $(img).height()
var img_height = parseInt($(img).attr('height'));
if (img_height < this.maxHeight) {
var margin = parseInt((this.maxHeight - img_height) / 2);
$(img).css('margin-top', margin);
Expand All @@ -60,7 +60,7 @@
};
Cycle2SlideShow.prototype.cycleBefore = function(e, opts, outSlide, inSlide) {
e.preventDefault();
this.centerImage(inSlide);
this.centerImage(inSlide.children[0]);
};
Cycle2SlideShow.prototype.thumbsClick = function(e) {
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion src/collective/js/cycle2/resources/utils.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5a17bcd

Please sign in to comment.