Skip to content

Commit

Permalink
Fixed for older JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
iangilman committed Apr 1, 2024
1 parent 2608b48 commit f90d981
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/iiiftilesource.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ $.IIIFTileSource = function( options ){
if( this.sizes ) {
var sizeLength = this.sizes.length;
if ( (sizeLength === options.maxLevel) || (sizeLength === options.maxLevel + 1) ) {
this.levelSizes = this.sizes.slice().sort(( size1, size2 ) => size1.width - size2.width);
this.levelSizes = this.sizes.slice().sort(function( size1, size2 ) {
return size1.width - size2.width;
});
// Need to take into account that the list may or may not include the full resolution size
if( sizeLength === options.maxLevel ) {
this.levelSizes.push( {width: this.width, height: this.height} );
Expand Down

0 comments on commit f90d981

Please sign in to comment.