X-Git-Url: https://scm.cri.mines-paristech.fr/git/Portfolio.git/blobdiff_plain/8a59623d303386b587ea30f8170cd0c66ec5d196..32e16df63fbc2df3a847347d4f58734f471bcd87:/skins/photo_film_viewer.js?ds=inline diff --git a/skins/photo_film_viewer.js b/skins/photo_film_viewer.js index 70fef4e..4c21355 100644 --- a/skins/photo_film_viewer.js +++ b/skins/photo_film_viewer.js @@ -92,15 +92,15 @@ FilmSlider.prototype.resizeSlider = function(evt) { var filmWidth = this.slideSize * this.filmLength; var sliderRatio = this.sliderRatio = filmBarWidth / filmWidth; var sliderWidth = filmBarWidth * sliderRatio; + this.rail.style.width = filmBarWidth + 'px'; + this.rail.style.display = 'block'; + this.rail.style.visibility = 'visible'; if (sliderRatio < 1) { - this.rail.style.width = filmBarWidth + 'px'; this.slider.style.width = Math.round(sliderWidth) + 'px'; - this.rail.style.display = 'block'; - this.rail.style.visibility = 'visible'; + this.slider.style.visibility = 'visible'; } else { - this.rail.style.display = 'none'; - this.rail.style.visibility = 'hidden'; + this.slider.style.visibility = 'hidden'; } this.winSize = {'width' : getWindowWidth(), @@ -122,9 +122,10 @@ FilmSlider.prototype.fitToScreen = function(evt) { FilmSlider.prototype._fitToScreen = function(evt) { var wh = getWindowHeight(); - var ch = document.body.clientHeight; + var rb = getObjectTop(this.rail) + getObjectHeight(this.rail); // rail bottom + var delta = wh - rb var sh = getObjectHeight(this.stretchable); - var newSize = sh + wh - ch; + var newSize = sh + delta; this.stretchable.style.height = newSize + 'px'; var ratio = this.image.height / this.image.width;