corrade-http-templates – Blame information for rev 57

Subversion Repositories:
Rev:
Rev Author Line No. Line
57 office 1 /*!
2 * jQuery UI Scroll Parent 1.12.1
3 * http://jqueryui.com
4 *
5 * Copyright jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
8 */
9  
10 //>>label: scrollParent
11 //>>group: Core
12 //>>description: Get the closest ancestor element that is scrollable.
13 //>>docs: http://api.jqueryui.com/scrollParent/
14  
15 ( function( factory ) {
16 if ( typeof define === "function" && define.amd ) {
17  
18 // AMD. Register as an anonymous module.
19 define( [ "jquery", "./version" ], factory );
20 } else {
21  
22 // Browser globals
23 factory( jQuery );
24 }
25 } ( function( $ ) {
26  
27 return $.fn.scrollParent = function( includeHidden ) {
28 var position = this.css( "position" ),
29 excludeStaticParent = position === "absolute",
30 overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
31 scrollParent = this.parents().filter( function() {
32 var parent = $( this );
33 if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
34 return false;
35 }
36 return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
37 parent.css( "overflow-x" ) );
38 } ).eq( 0 );
39  
40 return position === "fixed" || !scrollParent.length ?
41 $( this[ 0 ].ownerDocument || document ) :
42 scrollParent;
43 };
44  
45 } ) );