Sha256: 1d4c7539b4fd5294467c63eefc5adac4596d9e2b5e7543b35d8a52104c281707

Contents?: true

Size: 1.22 KB

Versions: 13

Compression:

Stored size: 1.22 KB

Contents

/*!
 * jQuery UI Scroll Parent 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: scrollParent
//>>group: Core
//>>description: Get the closest ancestor element that is scrollable.
//>>docs: http://api.jqueryui.com/scrollParent/

( function( factory ) {
	if ( typeof define === "function" && define.amd ) {

		// AMD. Register as an anonymous module.
		define( [ "jquery", "./version" ], factory );
	} else {

		// Browser globals
		factory( jQuery );
	}
} ( function( $ ) {

return $.fn.scrollParent = function( includeHidden ) {
	var position = this.css( "position" ),
		excludeStaticParent = position === "absolute",
		overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
		scrollParent = this.parents().filter( function() {
			var parent = $( this );
			if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
				return false;
			}
			return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
				parent.css( "overflow-x" ) );
		} ).eq( 0 );

	return position === "fixed" || !scrollParent.length ?
		$( this[ 0 ].ownerDocument || document ) :
		scrollParent;
};

} ) );

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
ext_yarn-0.6.0 vendor/jquery-ui/ui/scroll-parent.js
ext_yarn-0.5.0 vendor/jquery-ui/ui/scroll-parent.js
ext_yarn-0.4.0 vendor/jquery-ui/ui/scroll-parent.js
ext_yarn-0.3.1 vendor/jquery-ui/ui/scroll-parent.js
ext_yarn-0.3.0 vendor/jquery-ui/ui/scroll-parent.js
ext_yarn-0.2.0 vendor/jquery-ui/ui/scroll-parent.js
ext_yarn-0.1.2 node_modules/jquery-ui/ui/scroll-parent.js
ext_yarn-0.1.1 node_modules/jquery-ui/ui/scroll-parent.js
ext_yarn-0.1.0 node_modules/jquery-ui/ui/scroll-parent.js
ext_sprockets-0.1.6 node_modules/jquery-ui/ui/scroll-parent.js
ext_sprockets-0.1.5 node_modules/jquery-ui/ui/scroll-parent.js
ext_sprockets-0.1.1 node_modules/jquery-ui/ui/scroll-parent.js
date_picker-0.0.9 test/dummy/vendor/assets/components/jquery-ui/ui/scroll-parent.js