MediaWiki:JQuery.overlay.js

/** * jQuery plugin to overlay html elements over others. * * @author Ugochimobi */ ( function( $ ) {	'use strict';

var $overlay = null, style = null, css = { 'z-index': 100000005, 'background': 'white', 'position': 'relative' };

$.overlay = {

/**		 * Sets and returns the css styles used for the overlay elements. * @param {object} _css * @return {object} */		css: function( _css ) { if ( _css !== undefined ) { css = _css; }			return css; },

/**		 * Removes the overlay from the current overlay element and returns it. * @return {jQuery} */		remove: function { if ( $overlay !== null ) { $overlay.attr( 'style', style ? style : '' ); }			var _$overlay = $overlay; $overlay = null; return _$overlay; }	};

/**	 * Overlays the element over all other elements. * @return {jQuery} */	$.fn.overlay = function { $.overlay.remove; style = $( this ).attr( 'style' ); return ( $overlay = $( this ).css( css ) ); };

} )( jQuery );