fix #7281 - fix column resizing for merged cells
[roojs1] / ux / Lightbox.js
index a1b7551..46273de 100644 (file)
@@ -312,7 +312,7 @@ Roo.apply(Roo.ux.Lightbox.prototype,
                 position: 'absolute',
                 top: '0px',
                 width: '100%',
-                'z-index': '999'
+                'z-index': '40999'
             }
         });
     },
@@ -357,8 +357,12 @@ Roo.apply(Roo.ux.Lightbox.prototype,
         // stretch overlay to fill page and fade in
         //var arrayPageSize = this.getPageSize();
         
-        this.overlay.setHeight(Roo.lib.Dom.getDocumentHeight()) ;
-        this.overlay.setWidth(Roo.lib.Dom.getDocumentWidth());
+        this.onResize();
+       if (!this.resizer) {
+           this.resizer = Roo.EventManager.onWindowResize(this.onResize, this, true);;
+       }
+        
+       
         this.overlay.fadeIn({
                 endOpacity: this.overlayOpacity, 
                 easing: 'easeOut',
@@ -366,7 +370,7 @@ Roo.apply(Roo.ux.Lightbox.prototype,
         });
          
         //this.imageArray = [];
-        var imageNum = 0;       
+        var imageNum = -1;       
         
         if (imageLink) {
             imageLink = Roo.get(imageLink);
@@ -377,8 +381,13 @@ Roo.apply(Roo.ux.Lightbox.prototype,
                     imageNum = i;
                 }
             });
+           if (imageNum < 0) {
+               
+               this.imageArray.push(imageLink);
+               imageNum = this.imageArray.length-1;
+           }
         }
-        
+         
         // let's assume the constructor sorts out the list of images..
         /*
         if ((imageLink.rel == 'lightbox')){
@@ -399,12 +408,12 @@ Roo.apply(Roo.ux.Lightbox.prototype,
         // weird.. why / 10?
         
         //var lightboxTop = s.top + (Roo.lib.Dom.getViewHeight() / 10);
-        var lightboxTop = (Roo.lib.Dom.getViewHeight() / 10);
+        var lightboxTop = (Roo.lib.Dom.getViewHeight() / 10) + document.body.scrollTop;
         var lightboxLeft = s.left;
         this.lightbox.setStyle({ 
             top: lightboxTop + 'px', 
             left: lightboxLeft + 'px' ,
-            zIndex : 1000
+            zIndex : 41000
         });
         //console.log("show lightbox");
         this.lightbox.show();
@@ -413,6 +422,11 @@ Roo.apply(Roo.ux.Lightbox.prototype,
         this.changeImage(imageNum);
     },
 
+    onResize : function()
+    {
+       this.overlay.setHeight(Roo.lib.Dom.getDocumentHeight()) ;
+        this.overlay.setWidth(Roo.lib.Dom.getDocumentWidth());
+    },
     //
     //  changeImage()
     //  Hide most elements and preload image in preparation for resizing image container.
@@ -424,7 +438,7 @@ Roo.apply(Roo.ux.Lightbox.prototype,
         // hide elements during transition
         if (this.animate) {
             this.loading.setStyle({
-                zIndex :1200
+                zIndex : 41200
             });
             this.loading.show();
             this.loadinglink.setX( (Roo.lib.Dom.getViewWidth() / 2) - 16);