IE compatibility
[mkgallery.git] / include / showwin.js
index 00f91ce3727cb48e9efc3c1c1e332ed35c47555b..dfd3714f8ec668a14cf74e7fa029c9ef236050af 100644 (file)
@@ -19,8 +19,7 @@ var showWindow = new Class({
                        zIndex: 2,
                        container: document.body,
                        tohide: '',
-                       onClick: $empty,
-                       onKeypress: $empty,
+                       onClick: $empty
                }
        },
 
@@ -33,7 +32,7 @@ var showWindow = new Class({
                this.container = new Element('div').addClass(name).
                setProperties({
                        id: name,
-                       name: name,
+                       name: name
                }).setStyles({
                        position: 'absolute',
                        left: '0px',
@@ -44,8 +43,6 @@ var showWindow = new Class({
                        display: 'none'
                }).addEvent('click', function(){
                        this.options.onClick()
-               }.bind(this)).addEvent('keypress', function(){
-                       this.options.onKeypress()
                }.bind(this)).injectInside(this.options.container);
 
                window.addEvent('resize', this.position.bind(this));
@@ -73,7 +70,7 @@ var showWindow = new Class({
                return {
                        width: this.w,
                        height: this.h,
-                       top: this.s,
+                       top: this.s
                };
        },
 
@@ -83,7 +80,7 @@ var showWindow = new Class({
                                'display'
                        );
                        this.options.tohide.setStyles({
-                               display: 'none',
+                               display: 'none'
                        });
                }
                this.bodystyles = document.body.getStyles(
@@ -92,7 +89,7 @@ var showWindow = new Class({
                document.body.setStyles({
                        overflow: 'hidden',
                        'overflow-x': 'hidden',
-                       'overflow-y': 'hidden',
+                       'overflow-y': 'hidden'
                });
                this.position();
                this.container.setStyle('display', 'block');
@@ -104,7 +101,12 @@ var showWindow = new Class({
                }
                document.body.setStyles(this.bodystyles);
                this.container.setStyle('display', 'none');
+       },
+
+       grab: function(obj){
+               return this.container.grab(obj);
        }
-})
+});
+
 showWindow.implement(new Options);