This repository has been archived by the owner on Mar 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added inline SVG feature detection and use it for webkit fallbacks.
- Loading branch information
Showing
4 changed files
with
44 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,35 @@ | ||
/* | ||
* In general we assume modern on the mobile site. We don't need full | ||
* modernizr, but there are features we want to test for. | ||
*/ | ||
|
||
// Tests below are copied from Modernizr | ||
/*! | ||
* Modernizr v1.7 | ||
* http://www.modernizr.com | ||
* | ||
* Developed by: | ||
* - Faruk Ates http://farukat.es/ | ||
* - Paul Irish http://paulirish.com/ | ||
* | ||
* Copyright (c) 2009-2011 | ||
* Dual-licensed under the BSD or MIT licenses. | ||
* http://www.modernizr.com/license/ | ||
*/ | ||
|
||
|
||
(function() { | ||
|
||
"use strict"; | ||
|
||
// Inline SVG is not in iPhone or Android webkit _yet_, so we need to fallback. | ||
function inlineSVG() { | ||
var div = document.createElement('div'); | ||
div.innerHTML = '<svg/>'; | ||
return (div.firstChild && div.firstChild.namespaceURI) == 'http://www.w3.org/2000/svg'; | ||
} | ||
if(!inlineSVG()) { | ||
document.documentElement.className += ' ' + 'no-inlinesvg'; | ||
} | ||
|
||
}()); |