panel.js revision 69466ce67b8ee7c84e60821d469d82118db8e998
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass// TODO: Change this description!
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassProvides a Panel widget, a widget that mimics the functionality of a regular OS
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grovewindow. Comes with Standard Module support, XY Positioning, Alignment Support,
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan GroveStack (z-index) support, modality, auto-focus and auto-hide functionality, and
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Groveheader/footer button support.
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove@module panel
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glassvar getClassName = Y.ClassNameManager.getClassName;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass// TODO: Change this description!
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassA basic Panel Widget, which can be positioned based on Page XY co-ordinates and
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glassis stackable (z-index support). It also provides alignment and centering support
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glassand uses a standard module format for it's content, with header, body and footer
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glasssection support. It can be made modal, and has functionality to hide and focus
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glasson different events. The header and footer sections can be modified to allow for
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glassbutton support.
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove@extends Widget
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove@uses WidgetAutohide
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove@uses WidgetButtons
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove@uses WidgetModality
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove@uses WidgetPosition
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass@uses WidgetPositionAlign
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass@uses WidgetPositionConstrain
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass@uses WidgetStack
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove@uses WidgetStdMod
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove // Other Widget extensions depend on these two.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Collection of predefined buttons mapped from name => config.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Panel includes a "close" button which can be use by name. When the close
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass button is in the header (which is the default), it will look like: [x].
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass See `addButton()` for a list of possible configuration values.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // Panel with close button in header.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass var panel = new Y.Panel({
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass buttons: ['close']
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove // Panel with close button in footer.
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove var otherPanel = new Y.Panel({
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove footer: ['close']
4bc090583f2a5d4fee80ca7a79a993d4e5ac14ecRyan Grove @property BUTTONS
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass @type Object
6506cffe711cef12e98d0096a15b9de5ca07931bRyan Grove @default {close: {}}
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass @since 3.5.0
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass action: function () {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // TODO: API Docs.