Correcting type of DatabaseSqlite::insertId()
[mediawiki.git] / resources / jquery / jquery.footHovzer.js
blob56fc32d49226d38b224464fb6621ca93db72797f
1 /**
2  * Utility to stack stuff in an overlay fixed on the bottom of the page.
3  *
4  * Usage:
5  * <code>
6  *     var hovzer = $.getFootHovzer();
7  *     hovzer.$.append( $myCollection );
8  *     hovzer.update();
9  * </code>
10  *
11  * @author Timo Tijhof, 2012
12  */
13 ( function ( $ ) {
14         var $hovzer, footHovzer, prevHeight, newHeight;
16         function getHovzer() {
17                 if ( $hovzer === undefined ) {
18                         $hovzer = $( '<div id="jquery-foot-hovzer"></div>' ).appendTo( 'body' );
19                 }
20                 return $hovzer;
21         }
23         footHovzer = {
24                 update: function () {
25                         var $body;
27                         $body = $( 'body' );
28                         if ( prevHeight === undefined ) {
29                                 prevHeight = getHovzer().outerHeight( /*includeMargin=*/true );
30                                 $body.css( 'paddingBottom', '+=' + prevHeight + 'px' );
31                         } else {
32                                 newHeight = getHovzer().outerHeight( true );
33                                 $body.css( 'paddingBottom', ( parseFloat( $body.css( 'paddingBottom' ) ) - prevHeight ) + newHeight );
35                                 prevHeight = newHeight;
36                         }
37                 }
38         };
40         $.getFootHovzer = function () {
41                 footHovzer.$ = getHovzer();
42                 return footHovzer;
43         };
45 }( jQuery ) );