Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: static/js/index.js

Issue 29341378: Issue 4027 - make the download button available for windows insider users (Closed)
Patch Set: Created May 13, 2016, 10:40 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« includes/index.tmpl ('K') | « static/css/index.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: static/js/index.js
===================================================================
--- a/static/js/index.js
+++ b/static/js/index.js
@@ -29,6 +29,18 @@
function init()
{
container = document.getElementById("more-container");
+ if(document.getElementById("content").className.indexOf("edge") > -1)
Sebastian Noack 2016/05/17 08:50:13 Perhaps moving this check inside checkEdgeSupport(
saroyanm 2016/05/17 12:38:54 Done.
+ checkEdgeSupport();
+ }
+
+ function checkEdgeSupport()
+ {
+ if (!window.navigator.userAgent)
saroyanm 2016/05/13 10:50:20 userAgent detection through navigator is deprecate
Sebastian Noack 2016/05/17 08:50:13 I don't think there is a different way to detect t
saroyanm 2016/05/17 12:38:53 Acknowledged.
+ return;
+
+ var match = window.navigator.userAgent.match(/Edge\/(\d+.\d+)/);
+ if (match && match.length > 0 && parseFloat(match[1]) >= 14.14342)
Sebastian Noack 2016/05/17 08:50:13 The check for |match.length > 0| is redundant. If
saroyanm 2016/05/17 12:38:54 Done.
+ document.getElementById("content").className += " edge-supported";
Sebastian Noack 2016/05/17 08:50:13 How about using classList? We don't need to care a
saroyanm 2016/05/17 12:38:53 Good point
saroyanm 2016/05/17 12:38:54 Done.
}
init();
« includes/index.tmpl ('K') | « static/css/index.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld