aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorkborchers <k_borchers@yahoo.com>2011-09-21 10:42:07 -0500
committerkborchers <k_borchers@yahoo.com>2011-09-21 10:42:07 -0500
commit2196b74a3126dc2dedd4e91727dbc75c41dc45f5 (patch)
tree4ea912fa5e0cbd09f4a8e9346de961ec74a7142a /ui
parent6d430e4fd30a7e7c711d4f276db740d400eca04c (diff)
downloadjquery-ui-2196b74a3126dc2dedd4e91727dbc75c41dc45f5.tar.gz
jquery-ui-2196b74a3126dc2dedd4e91727dbc75c41dc45f5.zip
Popup: Added show/hide animations and a demo
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.popup.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/ui/jquery.ui.popup.js b/ui/jquery.ui.popup.js
index 15349bc23..487a53eea 100644
--- a/ui/jquery.ui.popup.js
+++ b/ui/jquery.ui.popup.js
@@ -22,7 +22,9 @@ $.widget( "ui.popup", {
position: {
my: "left top",
at: "left bottom"
- }
+ },
+ show: "slideDown",
+ hide: "fadeOut"
},
_create: function() {
if ( !this.options.trigger ) {
@@ -45,8 +47,9 @@ $.widget( "ui.popup", {
.attr( "aria-owns", this.element.attr( "id" ) );
this.element
- .addClass( "ui-popup" );
- this.close();
+ .addClass( "ui-popup" )
+ this._beforeClose();
+ this.element.hide();
this._bind(this.options.trigger, {
keydown: function( event ) {
@@ -159,8 +162,8 @@ $.widget( "ui.popup", {
of: this.options.trigger
}, this.options.position );
+ this._show( this.element, this.options.show );
this.element
- .show()
.attr( "aria-hidden", "false" )
.attr( "aria-expanded", "true" )
.position( position );
@@ -190,10 +193,8 @@ $.widget( "ui.popup", {
},
close: function( event ) {
- this.element
- .hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" );
+ this._beforeClose();
+ this._hide( this.element, this.options.hide );
this.options.trigger.attr( "tabindex" , 0 );
if ( this.removeTabIndex ) {
@@ -201,6 +202,12 @@ $.widget( "ui.popup", {
}
this.isOpen = false;
this._trigger( "close", event );
+ },
+
+ _beforeClose: function() {
+ this.element
+ .attr( "aria-hidden", "true" )
+ .attr( "aria-expanded", "false" );
}
});