Définition du comportement par défaut pour les requêtes ajax quelconques : on utilise...
[Portfolio.git] / skins / photo_lightbox_viewer.js
index 017dbc0..bb27a67 100644 (file)
@@ -11,19 +11,21 @@ var Lightbox;
 
 var reSelected = /.*selected.*/;
 
 
 var reSelected = /.*selected.*/;
 
-Lightbox = function(grid, toolbar, complete) {
+Lightbox = function(grid, toolbar, complete, container_type) {
        var self = this;
        this.grid = grid;
        this._buildSlidesIndex(); // set this.slides and this.lastSlide;
        this.fetchingDisabled = false;
        this.complete = complete;
        var self = this;
        this.grid = grid;
        this._buildSlidesIndex(); // set this.slides and this.lastSlide;
        this.fetchingDisabled = false;
        this.complete = complete;
+       this.container_type = container_type;
        this.toolbar = toolbar;
        if (toolbar) {
                this.toolbarFixed = false;
                addListener(window, 'scroll', function(evt){self.windowScrollToolbarlHandler(evt);});
        }
        addListener(window, 'scroll', function(evt){self.windowScrollGridHandler(evt);});
        this.toolbar = toolbar;
        if (toolbar) {
                this.toolbarFixed = false;
                addListener(window, 'scroll', function(evt){self.windowScrollToolbarlHandler(evt);});
        }
        addListener(window, 'scroll', function(evt){self.windowScrollGridHandler(evt);});
-       addListener(window, 'load', function(evt){ self.windowScrollGridHandler();});
+       // addListener(window, 'load', function(evt){ self.windowScrollGridHandler();});
+       registerStartupFunction(function(){ self.windowScrollGridHandler();});
        this.lastCBChecked = undefined;
        this.form = undefined;
        var parent = this.grid.parentNode;
        this.lastCBChecked = undefined;
        this.form = undefined;
        var parent = this.grid.parentNode;
@@ -198,6 +200,9 @@ Lightbox.prototype.onResponseLoad = function(req) {
                        this.fm.submitButton = undefined;
                        this.refreshGrid();
                        break;
                        this.fm.submitButton = undefined;
                        this.refreshGrid();
                        break;
+               default :
+                       this.fm.loadResponse(req);
+                       break;
        }
 };
 
        }
 };
 
@@ -372,8 +377,10 @@ Lightbox.prototype.fetchTail = function() {
        
        var url = absolute_url() +
                          '/portfolio_thumbnails_tail?start:int=' +
        
        var url = absolute_url() +
                          '/portfolio_thumbnails_tail?start:int=' +
-                         String(this.slides.length + 1 ) +
-                         '&size:int=10';
+                         String(this.slides.length) +
+                         '&size:int=10' +
+                         '&container_type=' +
+                         this.container_type;
        req.open('GET', url, true);
        req.send();
 };
        req.open('GET', url, true);
        req.send();
 };