Merge "selenium: invoke jobs to enforce eventual consistency"
[lhc/web/wiklou.git] / resources / src / mediawiki.debug / jquery.footHovzer.js
1 /**
2 * @private
3 * @class jQuery.plugin.footHovzer
4 */
5 ( function () {
6 var $hovzer, footHovzer, $spacer;
7
8 function getHovzer() {
9 if ( $hovzer === undefined ) {
10 $hovzer = $( '<div id="jquery-foot-hovzer"></div>' ).appendTo( 'body' );
11 }
12 return $hovzer;
13 }
14
15 /**
16 * Utility to stack stuff in an overlay fixed on the bottom of the page.
17 *
18 * Usage:
19 *
20 * var hovzer = $.getFootHovzer();
21 * hovzer.$.append( $myCollection );
22 * hovzer.update();
23 *
24 * @static
25 * @inheritable
26 * @return {jQuery.footHovzer}
27 */
28 $.getFootHovzer = function () {
29 footHovzer.$ = getHovzer();
30 return footHovzer;
31 };
32
33 /**
34 * @private
35 * @class jQuery.footHovzer
36 */
37 footHovzer = {
38
39 /**
40 * @property {jQuery} $ The stack container
41 */
42
43 /**
44 * Update dimensions of stack to account for changes in the subtree.
45 */
46 update: function () {
47 var $body;
48
49 $body = $( 'body' );
50
51 if ( $spacer === undefined ) {
52 $spacer = $( '<div>' ).attr( 'id', 'jquery-foot-hovzer-spacer' );
53 $spacer.appendTo( $body );
54 }
55 // Ensure CSS is applied by browser before using .outerHeight()
56 setTimeout( function () {
57 $spacer.css( 'height', getHovzer().outerHeight( /* includeMargin = */ true ) );
58 }, 0 );
59 }
60 };
61
62 /**
63 * @class jQuery
64 * @mixins jQuery.plugin.footHovzer
65 */
66
67 }() );