Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Commit ec49324

Browse files
authored
Merge pull request #77 from asos-dominicjomaa/feature/export-feature-detection-boolean
Enable Dynamic Enabling / Disabling without External Feature Detection
2 parents 88a1230 + a585181 commit ec49324

File tree

5 files changed

+782
-76
lines changed

5 files changed

+782
-76
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Disable iNoBounce.
6161
* **iNoBounce.isEnabled()**
6262
Returns a boolean indicating if iNoBounce is enabled.
6363

64+
* **iNoBounce.isScrollSupported**
65+
A boolean value that indicates if the `-webkit-overflow-scrolling` css property is valid, effectively a browser detection flag.
6466

6567
## Will it break my app that uses touch events like other solutions?
6668

inobounce.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,19 @@
106106
var testDiv = document.createElement('div');
107107
document.documentElement.appendChild(testDiv);
108108
testDiv.style.WebkitOverflowScrolling = 'touch';
109-
var scrollSupport = 'getComputedStyle' in window && window.getComputedStyle(testDiv)['-webkit-overflow-scrolling'] === 'touch';
109+
var isScrollSupported = 'getComputedStyle' in window && window.getComputedStyle(testDiv)['-webkit-overflow-scrolling'] === 'touch';
110110
document.documentElement.removeChild(testDiv);
111111

112-
if (scrollSupport) {
112+
if (isScrollSupported) {
113113
enable();
114114
}
115115

116116
// A module to support enabling/disabling iNoBounce
117117
var iNoBounce = {
118118
enable: enable,
119119
disable: disable,
120-
isEnabled: isEnabled
120+
isEnabled: isEnabled,
121+
isScrollSupported: isScrollSupported
121122
};
122123

123124
if (typeof module !== 'undefined' && module.exports) {

inobounce.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)