[SPIP] ~v3.0.17-->v3.0.19
[ptitvelo/web/www.git] / www / plugins-dist / mediabox / javascript / jquery.colorbox.js
index 8bb5151..d588171 100644 (file)
                }\r
        }\r
 \r
+       var init_dimensions = false;\r
        function launch(target) {\r
                if (!closing) {\r
-                       \r
+\r
                        element = target;\r
                        \r
                        makeSettings();\r
                        }\r
                        \r
                        if (!open) {\r
+                               if (!init_dimensions) {\r
+                                       init_dimensions = true;\r
+                                       // Cache values needed for size calculations\r
+                                       interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6\r
+                                       interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();\r
+                                       loadedHeight = $loaded.outerHeight(true);\r
+                                       loadedWidth = $loaded.outerWidth(true);\r
+\r
+                                       // Setting padding to remove the need to do size conversions during the animation step.\r
+                                       $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});\r
+                               }\r
+\r
                                open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.\r
                                \r
                                $box.show();\r
                        if (!init) {\r
                                init = true;\r
 \r
-                               // Cache values needed for size calculations\r
-                               interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6\r
-                               interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();\r
-                               loadedHeight = $loaded.outerHeight(true);\r
-                               loadedWidth = $loaded.outerWidth(true);\r
-                               \r
-                               // Setting padding to remove the need to do size conversions during the animation step.\r
-                               $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});\r
-\r
                                // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.\r
                                $next.click(function () {\r
                                        publicMethod.next();\r