X-Git-Url: https://scm.cri.ensmp.fr/git/Portfolio.git/blobdiff_plain/3940d117b095679f682c973f0bdc83e877b214e6..fd69eaaf44e7c071f179242936c737509eb667ef:/skins/photo_lightbox_viewer.js diff --git a/skins/photo_lightbox_viewer.js b/skins/photo_lightbox_viewer.js index d659ac1..c030fbb 100644 --- a/skins/photo_lightbox_viewer.js +++ b/skins/photo_lightbox_viewer.js @@ -14,10 +14,9 @@ var reSelected = /.*selected.*/; Lightbox = function(grid, toolbar, complete) { var self = this; this.grid = grid; - this.lastSlide = this.grid.children[this.grid.children.length-1]; + this._buildSlidesIndex(); // set this.slides and this.lastSlide; this.fetchingDisabled = false; this.complete = complete; - console.log('complete:', complete) this.toolbar = toolbar; if (toolbar) { this.toolbarFixed = false; @@ -47,6 +46,18 @@ Lightbox = function(grid, toolbar, complete) { } }; +Lightbox.prototype._buildSlidesIndex = function() { + this.slides = []; + var node, i; + for (i=0 ; i