Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 (function() | 1 (function() |
2 { | 2 { |
3 var visibleTab; | 3 var visibleTab; |
4 var container; | 4 var 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 |
(...skipping 11 matching lines...) Expand all Loading... | |
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 | 28 |
29 function init() | 29 function init() |
30 { | 30 { |
31 container = document.getElementById("more-container"); | 31 container = document.getElementById("more-container"); |
32 if(document.getElementById("content").className.indexOf("edge") > -1) | 32 checkEdgeSupport(); |
Sebastian Noack
2016/05/17 08:50:13
Perhaps moving this check inside checkEdgeSupport(
saroyanm
2016/05/17 12:38:54
Done.
| |
33 checkEdgeSupport(); | |
34 } | 33 } |
35 | 34 |
36 function checkEdgeSupport() | 35 function checkEdgeSupport() |
37 { | 36 { |
38 if (!window.navigator.userAgent) | 37 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.
| |
39 return; | 38 return; |
40 | 39 |
40 var content = document.getElementById("content"); | |
41 var match = window.navigator.userAgent.match(/Edge\/(\d+.\d+)/); | 41 var match = window.navigator.userAgent.match(/Edge\/(\d+.\d+)/); |
42 if (match && match.length > 0 && parseFloat(match[1]) >= 14.14342) | 42 if (match && 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.
|
Oleksandr
2016/05/18 12:53:15
14 is a version of an EdgeHTML. 14342 is a Windows
Sebastian Noack
2016/05/18 12:57:25
Yeah, I agree. However, it seems, the change alrea
|
43 document.getElementById("content").className += " edge-supported"; | 43 content.classList.contains("edge")) |
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.
| |
44 content.classList.add("edge-supported"); | |
44 } | 45 } |
45 | 46 |
46 init(); | 47 init(); |
47 })(); | 48 })(); |
LEFT | RIGHT |