X-Git-Url: https://svn.cri.ensmp.fr/git/Portfolio.git/blobdiff_plain/3940d117b095679f682c973f0bdc83e877b214e6..701bc8b75afb778fccb487daf948825c3eb2b881:/skins/photo_lightbox_viewer.js?ds=sidebyside diff --git a/skins/photo_lightbox_viewer.js b/skins/photo_lightbox_viewer.js index d659ac1..a4c9a25 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