Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added inline SVG feature detection and use it for webkit fallbacks.

  • Loading branch information...
commit 0995a5cd937227e8494c674cfbe80f2053091f1a 1 parent 2e6ca1e
@rlr rlr authored
View
9 mobile.css
@@ -284,6 +284,10 @@ header #home {
padding: 14px 0;
line-height: 14px;
}
+.no-inlinesvg header #home {
+ background: transparent url(../global/mobile/homeicon.png) no-repeat 0 12px;
+ padding-left: 22px;
+}
.mini-header .site-title a {
font-size: 22px;
line-height: 22px;
@@ -420,6 +424,7 @@ a.listview:before {
}
#search button[type=submit] {
+ display: block;
margin: 0;
height: 45px;
width: 56px;
@@ -434,6 +439,10 @@ a.listview:before {
vertical-align: middle;
}
+.no-inlinesvg #search button[type=submit] {
+ background: transparent url(../global/mobile/searchbtn.png) no-repeat left top;
+}
+
/************************************/
/* FOOTER */
/************************************/
View
BIN  mobile/homeicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  mobile/searchbtn.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
35 mobilefeatures.js
@@ -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';
+}
+
+}());
Please sign in to comment.
Something went wrong with that request. Please try again.