You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
- Implements TWBS body padding fix to keep content in an element
with a container class from shifting when the body overflow is
set to hidden with the modal-open class.
Fixes#2631Closes#5711
Copy file name to clipboardExpand all lines: src/position/docs/readme.md
+50-2
Original file line number
Diff line number
Diff line change
@@ -45,15 +45,60 @@ Gets the closest positioned ancestor.
45
45
*_(Type: `element`)_ -
46
46
The closest positioned ancestor.
47
47
48
-
#### scrollbarWidth()
48
+
#### scrollbarWidth(isBody)
49
49
50
50
Calculates the browser scrollbar width and caches the result for future calls. Concept from the TWBS measureScrollbar() function in [modal.js](https://github.com/twbs/bootstrap/blob/master/js/modal.js).
51
51
52
+
##### parameters
53
+
54
+
*`isBody`
55
+
_(Type: `boolean`, Default: `false`, optional)_ - Is the requested scrollbar width for the body/html element. IE and Edge overlay the scrollbar on the body/html element and should be considered 0.
56
+
52
57
##### returns
53
58
54
59
*_(Type: `number`)_ -
55
60
The width of the browser scrollbar.
56
61
62
+
#### scrollbarPadding(element)
63
+
64
+
Calculates the padding required to replace the scrollbar on an element.
65
+
66
+
##### parameters
67
+
68
+
* 'element' _(Type: `element`)_ - The element to calculate the padding on (should be a scrollable element).
69
+
70
+
##### returns
71
+
72
+
An object with the following properties:
73
+
74
+
*`scrollbarWidth`
75
+
_(Type: `number`)_ -
76
+
The width of the scrollbar.
77
+
78
+
*`widthOverflow`
79
+
_(Type: `boolean`)_ -
80
+
Whether the width is overflowing.
81
+
82
+
*`right`
83
+
_(Type: `number`)_ -
84
+
The total right padding required to replace the scrollbar.
85
+
86
+
*`originalRight`
87
+
_(Type: `number`)_ -
88
+
The oringal right padding on the element.
89
+
90
+
*`heightOverflow`
91
+
_(Type: `boolean`)_ -
92
+
Whether the height is overflowing.
93
+
94
+
*`bottom`
95
+
_(Type: `number`)_ -
96
+
The total bottom padding required to replace the scrollbar.
97
+
98
+
*`originalBottom`
99
+
_(Type: `number`)_ -
100
+
The oringal bottom padding on the element.
101
+
57
102
#### isScrollable(element, includeHidden)
58
103
59
104
Determines if an element is scrollable.
@@ -72,7 +117,7 @@ Determines if an element is scrollable.
Gets the closest scrollable ancestor. Concept from the jQueryUI [scrollParent.js](https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js).
78
123
@@ -85,6 +130,9 @@ Gets the closest scrollable ancestor. Concept from the jQueryUI [scrollParent.j
85
130
*`includeHidden`
86
131
_(Type: `boolean`, Default: `false`, optional)_ - Should scroll style of 'hidden' be considered.
87
132
133
+
*`includeSelf`
134
+
_(Type: `boolean`, Default: `false`, optional)_ - Should the element passed in be included in the scrollable lookup.
0 commit comments