Class
| Return | Name | Description |
| Control.Window | open([Element container [,Hash options]]) | Creates a window, opens it then returns it. |
| number | baseZIndex | Defaults to 9999. |
| array | windows | Returns all windows, open or closed, in the order they were created. |
Instance
| Return | Name | Description |
| Control.Window | initialize([Element container [,Hash options]]) | See the tutorial for the different behaviors based on the lack of, or type of container passed. |
| null | bringToFront() | |
| bool | close([Event]) | |
| null | destroy() | |
| null | ensureInBounds() | Redraws the window inside the viewport bounds if it is currently outside. |
| bool | open([Event]) | |
| null | position([Event]) | Repositions the window. |
Options
| Type | Name | Default | Description |
| mixed | className | false | Class name to apply to the container. |
| mixed | closeOnClick | false | false, string 'container', string 'overlay' or Element. |
| bool | constrainToViewport | false | If draggable, the window will stay in bounds of the viewport. May not work with scrollable windows. |
| mixed | draggable | false | If true, div.draggable_handle will be inserted into the container, which will become the draggable handle. If Element is passed, the element will become the handle. |
| bool | fade | false | |
| number | fadeDuration | 0.75 | |
| mixed | height | null | Can be null, number (in pixels), or function returning number. |
| mixed | hover | false | Element object to hover over, or if "true" only available for windows with sourceContainer (an anchor or any element already on the page with an href attribute). |
| bool | iframe | false | If the window has an href, this will display the href as an iframe instead of requesting the url as an an Ajax.Request. |
| bool | iframeshim | true | Positions an iFrameShim underneath the window. |
| mixed | indicator | false | false or Element to show and hide when ajax requests, images and iframes are loading. |
| mixed | insertRemoteContentAt | this.container | Element to insert Ajax, IFrame or Lightbox content into. Can be string selector for this.container.down(), or an Element that must be a child of this.container. |
| mixed | maxHeight | false | For resizable. Can be false or number in pixels. |
| mixed | maxWidth | false | For resizable. Can be false or number in pixels. |
| mixed | minHeight | false | For resizable. Can be false or number in pixels. |
| mixed | minWidth | false | For resizable. Can be false or number in pixels. |
| mixed | offsetLeft | 0 | number x or function(){return x} |
| mixed | offsetTop | 0 | number y or function(){return y} |
| Hash | parameters | {} | Will be passed to Ajax.Request if it is an Ajax window. |
| mixed | position | 'center' | Can be string 'center', string 'relative' (to related element position), string 'mouse' (will follow the mouse), array [number x, number y] or array [function(){return x},function(){return y}] |
| mixed | resizable | false | If true, div.resizable_handle will be inserted into the container, which will become the resizable handle. If Element is passed, the element will become the handle. |
| mixed | width | null | Can be null, number (in pixels), or function returning number. |
Events
| Name | Description |
| afterClose() | |
| afterDestroy() | |
| afterInitialize() | |
| afterOpen() | |
| beforeClose() | Throwing $break inside a callback will prevent the window from opening. |
| beforeOpen() | Throwing $break inside a callback will prevent the window from opening. |
| bringToFront() | |
| onComplete(object request) | Ajax windows only. |
| onDrag() | Draggable windows only. |
| onException(object request, object exception) | Ajax windows only. |
| onFailure(object request) | Ajax windows only. |
| onRemoteContentLoaded() | Iframe, Ajax and LightBox windows will trigger this event. |
| onResize() | Resizable windows only. |
| onSuccess(object request) | Ajax windows only. |
Control.Overlay Class
| Return | Name | Description |
| null | load() | |
| null | hide() | |
| null | show() | |
Control.Overlay Events
| Name | Description |
| afterHide() | |
| afterShow() | |
| beforeHide() | Throwing $break will prevent the overlay from being hidden. |
| beforeShow() | Throwing $break will prevent the overlay from being shown. |
Control.Window Subclasses
All subclasses below inherit all of the methods, options and events from Control.Window.
Control.ToolTip Instance
| Return | Name | Description |
| Control.ToolTip | initialize(Element container [,mixed tooltip [,Hash options]]) | Tooltip can be a string, or an Element that is already on the page. |
Control.Modal Class
| Return | Name | Description |
| null | close() | Closes current Modal if one is open. |
| Control.Modal | open([Element container [,Hash options]]) | |
| mixed | current | False, or Control.Modal. |
Control.Modal Instance
| Return | Name | Description |
| Control.Modal | initialize([Element container [,Hash options]]) | |
Control.Modal Options
| Type | Name | Default | Description |
| number | overlayOpacity | 0.5 | |
Control.LightBox Instance
| Return | Name | Description |
| Control.LightBox | open([Element container [,Hash options]]) | |
Control.LightBox Options
| Type | Name | Default | Description |
| bool | modal | false | Will act as a Control.Modal instead of a Control.Window if true. |
Interesting, possibly useful prototype based window control.