File tree Expand file tree Collapse file tree 5 files changed +47
-16
lines changed Expand file tree Collapse file tree 5 files changed +47
-16
lines changed Original file line number Diff line number Diff line change 32
32
"./safe-active-element" ,
33
33
"./safe-blur" ,
34
34
"./tabbable" ,
35
+ "./scroll-parent" ,
35
36
"./version"
36
37
] , factory ) ;
37
38
} else {
43
44
44
45
// plugins
45
46
$ . fn . extend ( {
46
- scrollParent : function ( includeHidden ) {
47
- var position = this . css ( "position" ) ,
48
- excludeStaticParent = position === "absolute" ,
49
- overflowRegex = includeHidden ? / ( a u t o | s c r o l l | h i d d e n ) / : / ( a u t o | s c r o l l ) / ,
50
- scrollParent = this . parents ( ) . filter ( function ( ) {
51
- var parent = $ ( this ) ;
52
- if ( excludeStaticParent && parent . css ( "position" ) === "static" ) {
53
- return false ;
54
- }
55
- return overflowRegex . test ( parent . css ( "overflow" ) + parent . css ( "overflow-y" ) + parent . css ( "overflow-x" ) ) ;
56
- } ) . eq ( 0 ) ;
57
-
58
- return position === "fixed" || ! scrollParent . length ? $ ( this [ 0 ] . ownerDocument || document ) : scrollParent ;
59
- } ,
60
47
61
48
uniqueId : ( function ( ) {
62
49
var uuid = 0 ;
Original file line number Diff line number Diff line change 22
22
// AMD. Register as an anonymous module.
23
23
define ( [
24
24
"jquery" ,
25
+ "./core" ,
25
26
"./version" ,
26
27
"./keycode" ,
27
28
"./widget" ,
Original file line number Diff line number Diff line change 20
20
// AMD. Register as an anonymous module.
21
21
define ( [
22
22
"jquery" ,
23
- "./core" ,
24
23
"./data" ,
25
24
"./mouse" ,
26
25
"./plugin" ,
27
26
"./safe-active-element" ,
28
27
"./safe-blur" ,
28
+ "./scroll-parent" ,
29
29
"./version" ,
30
30
"./widget"
31
31
] , factory ) ;
Original file line number Diff line number Diff line change
1
+ /*!
2
+ * jQuery UI Scroll Parent @VERSION
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 ? / ( a u t o | s c r o l l | h i d d e n ) / : / ( a u t o | s c r o l l ) / ,
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" ) + parent . css ( "overflow-x" ) ) ;
37
+ } ) . eq ( 0 ) ;
38
+
39
+ return position === "fixed" || ! scrollParent . length ? $ ( this [ 0 ] . ownerDocument || document ) : scrollParent ;
40
+ } ;
41
+
42
+ } ) ) ;
Original file line number Diff line number Diff line change 22
22
"jquery" ,
23
23
"./core" ,
24
24
"./data" ,
25
+ "./version" ,
25
26
"./ie" ,
26
27
"./mouse" ,
27
- "./version " ,
28
+ "./scroll-parent " ,
28
29
"./widget"
29
30
] , factory ) ;
30
31
} else {
You can’t perform that action at this time.
0 commit comments