Fix issue with slimbox when pressing ENTER
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 5 Sep 2013 11:20:32 +0000 (13:20 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 5 Sep 2013 11:21:42 +0000 (13:21 +0200)
see http://beta.woltlab.com/index.php/Thread/3561-Scroll-Leiste-verschwindet/?postID=29867#post29867

wcfsetup/install/files/js/3rdParty/slimbox2.js

index db5488049c0abc5ad6c02594c29d8ebfc7b7e098..795892ba2efec01adbca448c577f0791bd9a11b6 100644 (file)
                        _images = [[_images, startImage]];
                        startImage = 0;
                }
-
-               middle = win.scrollTop() + (win.height() / 2);
-               centerWidth = options.initialWidth;
-               centerHeight = options.initialHeight;
-               $(center).css({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2}).show();
-               compatibleOverlay = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed"));
-               if (compatibleOverlay) overlay.style.position = "absolute";
-               $(overlay).css("opacity", options.overlayOpacity).fadeIn(options.overlayFadeDuration);
+               
                // WoltLab modifications        BEGIN
+               if (activeImage == -1) {
+                       middle = win.scrollTop() + (win.height() / 2);
+                       centerWidth = options.initialWidth;
+                       centerHeight = options.initialHeight;
+                       $(center).css({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2}).show();
+                       compatibleOverlay = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed"));
+                       if (compatibleOverlay) overlay.style.position = "absolute";
+                       $(overlay).css("opacity", options.overlayOpacity).fadeIn(options.overlayFadeDuration);
                
-               WCF.System.DisableScrolling.disable();
+                       WCF.System.DisableScrolling.disable();
                
+                       position();
+                       setup(1);
+               }
                // WoltLab modifications        END
-               position();
-               setup(1);
-
+               
                images = _images;
                options.loop = options.loop && (images.length > 1);
                return changeImage(startImage);