Updated Slimbox to 2.0.5
authorAlexander Ebert <ebert@woltlab.com>
Tue, 21 May 2013 19:47:52 +0000 (21:47 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 21 May 2013 19:47:52 +0000 (21:47 +0200)
wcfsetup/install/files/js/3rdParty/slimbox2.js

index 72ff5b72e9e4719b2bcc9de3b65f4f73a30135e9..db5488049c0abc5ad6c02594c29d8ebfc7b7e098 100644 (file)
@@ -1,6 +1,6 @@
 /*!
-       Slimbox v2.04 - The ultimate lightweight Lightbox clone for jQuery
-       (c) 2007-2010 Christophe Beyls <http://www.digitalia.be>
+       Slimbox v2.05 - The ultimate lightweight Lightbox clone for jQuery
+       (c) 2007-2013 Christophe Beyls <http://www.digitalia.be>
        MIT-style license.
        
        Modified by WoltLab GmbH to support large images.
@@ -26,7 +26,7 @@
                // Append the Slimbox HTML code at the bottom of the document
                $("body").append(
                        $([
-                               overlay = $('<div id="lbOverlay" />')[0],
+                               overlay = $('<div id="lbOverlay" />').click(close)[0],
                                center = $('<div id="lbCenter" />')[0],
                                bottomContainer = $('<div id="lbBottomContainer" />')[0]
                        ]).css("display", "none")
@@ -40,7 +40,7 @@
                )[0];
 
                bottom = $('<div id="lbBottom" />').appendTo(bottomContainer).append([
-                       $('<a id="lbCloseLink" href="#" />').add(overlay).click(close)[0],
+                       $('<a id="lbCloseLink" href="#" />').click(close)[0],
                        caption = $('<div id="lbCaption" />')[0],
                        number = $('<div id="lbNumber" />')[0],
                        $('<div style="clear: both;" />')[0]
        }
 
        function keyDown(event) {
-               var code = event.keyCode, fn = $.inArray;
+               var code = event.which, fn = $.inArray;
                // Prevent default keyboard action (like navigating inside the page)
                return (fn(code, options.closeKeys) >= 0) ? close()
                        : (fn(code, options.nextKeys) >= 0) ? next()
                        : (fn(code, options.previousKeys) >= 0) ? previous()
-                       : false;
+                       : null;
        }
 
        function previous() {
                        activeImage = prevImage = nextImage = -1;
                        $(center).hide();
                        $(overlay).stop().fadeOut(options.overlayFadeDuration, setup);
+                       
                        // WoltLab modifications        BEGIN
                        
                        WCF.System.DisableScrolling.enable();