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

Delta Between Two Patch Sets: static/js/index.js

Issue 29541876: Noissue - Always show "Install" button for Microsoft Edge (Closed)
Left Patch Set: Created Sept. 11, 2017, 5:12 p.m.
Right Patch Set: Always show button Created Sept. 12, 2017, 8:29 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« includes/index.tmpl ('K') | « static/css/index.css ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 (function() 1 (function()
2 { 2 {
3 var visibleTab; 3 var visibleTab;
4 var container; 4 var container = document.getElementById("more-container");
5 5
6 window.toggleMore = function() 6 window.toggleMore = function()
7 { 7 {
8 if (container.className == "hidden") 8 if (container.className == "hidden")
9 container.className = visibleTab || getDefaultTab(); 9 container.className = visibleTab || getDefaultTab();
10 else 10 else
11 container.className = "hidden"; 11 container.className = "hidden";
12 } 12 }
13 13
14 window.showTab = function(button) 14 window.showTab = function(button)
15 { 15 {
16 var id = button.id.substr(5); 16 var id = button.id.substr(5);
17 container.className = id; 17 container.className = id;
18 visibleTab = id; 18 visibleTab = id;
19 } 19 }
20 20
21 function getDefaultTab() 21 function getDefaultTab()
22 { 22 {
23 var content = document.getElementById("content"); 23 var content = document.getElementById("content");
24 var ua = content.className.match(/ua\-([^\s]+)/); 24 var ua = content.className.match(/ua\-([^\s]+)/);
25 visibleTab = ua && ua[1] || "firefox"; 25 visibleTab = ua && ua[1] || "firefox";
26 return visibleTab; 26 return visibleTab;
27 } 27 }
28
29 function init()
30 {
31 container = document.getElementById("more-container");
32 checkEdgeSupport();
33 }
34
35 function checkEdgeSupport()
36 {
37 if (!window.navigator.userAgent)
38 return;
39
40 var content = document.getElementById("content");
41 var match = window.navigator.userAgent.match(/Edge\/\d+\.(\d+)/);
42 if (match && match[1] >= 15063 && content.classList.contains("edge"))
Oleksandr 2017/09/12 00:25:57 It's outside the scope of this change, but I just
Sebastian Noack 2017/09/12 00:58:20 What would users see on XBox and Windows Phone, wh
juliandoucette 2017/09/12 11:47:17 I second Sebastian's question. Can you test this?
Oleksandr 2017/09/12 17:20:08 I am actually fairly confident Windows Store would
43 content.classList.add("edge-supported");
44 }
45
46 init();
47 })(); 28 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld