Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
[popup] Flatten widget methods: move timeout that triggers focus and …
Browse files Browse the repository at this point in the history
…"popupafteropen" to the widget level
  • Loading branch information
Gabriel Schulhof committed Oct 3, 2012
1 parent ff74d34 commit b97dec4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/widgets/popup.js
Expand Up @@ -499,6 +499,11 @@ define( [ "jquery",
return { x: x, y: y };
},

_completeOpen: function() {
this._ui.container.attr( "tabindex", "0" ).focus();
this._trigger( "afteropen" );
},

_openPrereqsComplete: function() {
var self = this;

Expand All @@ -509,10 +514,7 @@ define( [ "jquery",
// Android appears to trigger the animation complete before the popup
// is visible. Allowing the stack to unwind before applying focus prevents
// the "blue flash" of element focus in android 4.0
setTimeout(function(){
self._ui.container.attr( "tabindex", "0" ).focus();
self._trigger( "afteropen" );
});
setTimeout( $.proxy( this, "_completeOpen" ) );
},

_open: function( options ) {
Expand Down

0 comments on commit b97dec4

Please sign in to comment.