Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GalleriaJS/galleria
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: hennikul/galleria
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jan 30, 2015

  1. Added support for retina images using srcset in img tag.

    - Used by adding srcset string when pushing images to gallery.
    hennikul committed Jan 30, 2015
    Copy the full SHA
    c96cea8 View commit details
  2. Copy the full SHA
    799216b View commit details
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/galleria.js
17 changes: 17 additions & 0 deletions src/galleria.js
Original file line number Diff line number Diff line change
@@ -4905,6 +4905,17 @@ this.prependChild( 'info', 'myElement' );

self._layers[index].innerHTML = self.getData().layer || '';

// Set srcset in img tag for responsive retina images.
if (data.srcset) {
$( image.image ).attr( 'srcset', data.srcset );
if (image.width) {
$( image.image ).attr( 'sizes', image.width+"px" );
} else {
// We don't know the size of the image yet, but it can't be wider than the viewport
$( image.image ).attr( 'sizes', "100wv" );
}
}

self.trigger($.extend(evObj, {
type: Galleria.LOADFINISH
}));
@@ -5151,6 +5162,12 @@ this.prependChild( 'info', 'myElement' );

complete: function( next ) {

// Set srcset in img tag for responsive retina images.
if (data.srcset) {
$( next.image ).attr( 'srcset', data.srcset );
$( next.image ).attr( 'sizes', next.width+"px" );
}

// toggle low quality for IE
if ( 'image' in active ) {
Utils.toggleQuality( active.image, false );