Skip to content

Commit

Permalink
Merge pull request #2153 from ishitagupta94/#2152-Improve-Image-Optim…
Browse files Browse the repository at this point in the history
…ization

Improved Image Optimization Funtion
  • Loading branch information
Manish Kumar authored Mar 25, 2022
2 parents 6cdfe7a + 87d981a commit c1129c3
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,7 @@ $(document).ready(function () {
$(imgEl).parents('[data-gjs-type="link"]').css('width', '100%');

var imgWidth;

if (image.attributes.type == 'image-gallery-item' || image.attributes.type == 'carousel-image')
imgWidth = $(imgEl).parents('.picture-box').width();
else {

$(imgEl).parents('.image-box').css('width', '100%');
imgWidth = $(imgEl).parents('.image-box').width();
$(imgEl).parents('.image-box').css('width', '');
}
imgWidth = $(imgEl).parents('.picture-box').width();

if (imgWidth && imgWidth > 0) {
var calcWidth = Math.round((imgWidth / size) * 100);
Expand Down

0 comments on commit c1129c3

Please sign in to comment.