]> www.average.org Git - mkgallery.git/blobdiff - include/overlay.js
remove creation of the rss/atom feeds - it does not work anyway
[mkgallery.git] / include / overlay.js
index 432a0763790766ca23f67193b61e1df56024d594..078b75a1e93a1d78f67c708a08c280ff8f04c2cf 100644 (file)
@@ -1,7 +1,7 @@
 \r
 /**************************************************************\r
 \r
-       Script          : Overlay\r
+       Script          : overlay\r
        Version         : 1.2\r
        Authors         : Samuel birch\r
        Desc            : Covers the window with a semi-transparent layer.\r
@@ -9,7 +9,7 @@
 \r
 **************************************************************/\r
 \r
-var Overlay = new Class({\r
+var overlay = new Class({\r
        \r
        getOptions: function(){\r
                return {\r
@@ -17,7 +17,7 @@ var Overlay = new Class({
                        opacity: 0.7,\r
                        zIndex: 1,\r
                        container: document.body,\r
-                       onClick: Class.empty\r
+                       _onClick: $empty\r
                };\r
        },\r
 \r
@@ -38,7 +38,7 @@ var Overlay = new Class({
                        'id': 'OverlayIframe',\r
                        'name': 'OverlayIframe',\r
                        'src': 'javascript:void(0);',\r
-                       'frameborder': 1,\r
+                       'frameborder': 0,\r
                        'scrolling': 'no'\r
                }).setStyles({\r
                        'position': 'absolute',\r
@@ -61,16 +61,23 @@ var Overlay = new Class({
                        backgroundColor: this.options.colour\r
                }).injectInside(this.container);\r
                \r
-               this.container.addEvent('click', function(){\r
-                       this.options.onClick();\r
-               }.bind(this));\r
+               if(this.options._onClick){\r
+                       this.container.addEvent('click', function(){\r
+                               this.options._onClick.call(this)\r
+                       }.bind(this));\r
+               }\r
                \r
-               this.fade = new Fx.Tween(this.container, 'opacity').set(0);\r
+               //this.fade = new Fx.Tween(this.container).set('opacity', 0);\r
+               this.container.fade('hide');\r
                this.position();\r
                \r
                window.addEvent('resize', this.position.bind(this));\r
        },\r
        \r
+       setOnClick: function(func){\r
+               this.container.addEvent('click', func);\r
+       },\r
+       \r
        position: function(){ \r
                if(this.options.container == document.body){ \r
                        var h = window.getScrollHeight()+'px'; \r
@@ -87,14 +94,16 @@ var Overlay = new Class({
        },\r
        \r
        show: function(){\r
-               this.fade.start(0,this.options.opacity);\r
+               //this.fade.start(0,this.options.opacity);\r
+               this.container.fade(this.options.opacity);\r
        },\r
        \r
        hide: function(){\r
-               this.fade.start(this.options.opacity,0);\r
+               //this.fade.start(this.options.opacity,0);\r
+               this.container.fade('out');\r
        }\r
        \r
 });\r
-Overlay.implement(new Options);\r
+overlay.implement(new Options);\r
 \r
 /*************************************************************/\r