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

Side by Side Diff: static/js/index.js

Issue 29541876: Noissue - Always show "Install" button for Microsoft Edge (Closed)
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:
View unified diff | Download patch
« includes/index.tmpl ('K') | « static/css/index.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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] >= 14361 && content.classList.contains("edge"))
43 content.classList.add("edge-supported");
44 }
45
46 init();
47 })(); 28 })();
OLDNEW
« 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