X-Git-Url: https://svn.cri.ensmp.fr/git/Portfolio.git/blobdiff_plain/cd282ee58b2893790d06ce40a8b02c65481abbeb..bf33c9ca85d7668e07e0a98d7af0be131d665b31:/skins/photo_film_viewer.js diff --git a/skins/photo_film_viewer.js b/skins/photo_film_viewer.js index 3140763..fa929b2 100644 --- a/skins/photo_film_viewer.js +++ b/skins/photo_film_viewer.js @@ -5,8 +5,6 @@ Licence Creative Commons http://creativecommons.org/licenses/by-nc/2.0/ */ var FilmSlider; -var s; - (function(){ var keyLeft = 37, keyRight = 39; @@ -17,7 +15,6 @@ var DEFAULT_IMAGE_SIZES = [500, 600, 800]; FilmSlider = function(filmBar, slider, ctxInfos, image, toolbar, breadcrumbs) { var thisSlider = this; - s = this; this.filmBar = filmBar; this.filmBarWidth = getObjectWidth(this.filmBar); var film = filmBar.firstChild; @@ -148,10 +145,11 @@ FilmSlider.prototype._checkSize = function(evt) { FilmSlider.prototype._checkSizeStability = function(evt) { var self = this; var i; + var checkAgain = function(evt){self._checkSizeStability();}; for (i=0 ; i rightSize) { for (i = this.center - rightSize - 1 ; i >= 0 ; i--) { - console.log(i); this.thumbnailsLoadingOrder.push(thumbnails[i]); } } else if (leftSize < rightSize) { - for (i = this.center + leftSize ; i < thumbnails.length ; i++) { + for (i = this.center + leftSize + 1 ; i < thumbnails.length ; i++) { this.thumbnailsLoadingOrder.push(thumbnails[i]); } } var next = this.thumbnailsLoadingOrder.shift(); var self = this; addListener(next, 'load', function(evt){self._loadNextThumb(evt);}); - next.src = next.parentNode.href + '/getThumbnail'; + next.src = this.translateImgUrl(next.parentNode.href) + '/getThumbnail'; }; FilmSlider.prototype._loadNextThumb = function(evt) { @@ -762,7 +791,7 @@ FilmSlider.prototype._loadNextThumb = function(evt) { if (!next) {return;} var self = this; addListener(next, 'load', function(evt){self._loadNextThumb(evt);}); - next.src = next.parentNode.href + '/getThumbnail'; + next.src = this.translateImgUrl(next.parentNode.href) + '/getThumbnail'; };