Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: d4d1400f5f
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (44 sloc) 1.437 kB
A control that covers the entire viewport, typically to swallow clicks.
<Control className="Overlay" generic="true">
bottom: 0;
cursor: default;
position: fixed;
top: 0;
left: 0;
right: 0;
* The target of the overlay is the element which will end up visually
* in front of the overlay.
* Setting the target adds the overlay to the DOM (or moves it, if already
* in the DOM) to come before the target element. The result of this is that
* the overlay will sit visually behind the target.
* If there are elements with a z-index in the same stacking context as the
* target, the target should also have a z-index applied to it. The
* overlay will pick up this same z-index. As long as the target element
* visually appears in front of the other elements, so too will the overlay.
target: function( target ) {
if ( target === null ) {
// Clearing target; nothing to do right now.
var targetZIndex = parseInt( target.css( "z-index" ) );
if ( targetZIndex ) {
// Overlay gets same z-index as target.
this.css( "z-index", targetZIndex );
return this.insertBefore( target );
Jump to Line
Something went wrong with that request. Please try again.