-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DOM PointerEvents test as Modernizr.pointerevents
- Loading branch information
Showing
5 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
define(['Modernizr', 'domPrefixes', 'hasEvent'], function( Modernizr, domPrefixes, hasEvent ) { | ||
// **Test name hijacked!** | ||
// Now refers to W3C DOM PointerEvents spec: http://www.w3.org/Submission/pointer-events/ | ||
// For CSS pointer-events test, see feature-detects/css/pointerevents.js | ||
Modernizr.addTest('pointerevents', function () { | ||
// Cannot use `.prefixed()` for events, so test each prefix | ||
var bool = false, | ||
i = domPrefixes.length; | ||
|
||
// Don't forget un-prefixed... | ||
bool = Modernizr.hasEvent('pointerdown'); | ||
|
||
while (i-- && !bool) { | ||
if (hasEvent(domPrefixes[i] + 'pointerdown')) { | ||
bool = true; | ||
} | ||
} | ||
return bool; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters