Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.

Commit 6362eb7

Browse files
committed
Allow flexbox settings for IE >= 10
1 parent 10bd6fb commit 6362eb7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Styles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ const styles = {
199199
},
200200
};
201201

202-
// Use fallback styles for IE users
203-
if (Util.isIE()) {
202+
// Use fallback styles for browsers without flexbox support
203+
if (Util.getIEVersion() < 10) {
204204
styles.toolbar = {
205205
backgroundColor : 'rgba(0, 0, 0, 0.5)',
206206
position : 'absolute',

src/Util.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
2-
* Checks if the user is using Internet Explorer
2+
* Get the version of Internet Explorer in use, or undefined
33
*
4-
* @return {boolean} isIE - True if the user is on IE
4+
* @return {?number} ieVersion - IE version as an integer, or undefined if not IE
55
*/
6-
function isIE() {
7-
var ua = window.navigator.userAgent;
8-
return ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1;
6+
function getIEVersion() {
7+
var match = navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
8+
return match ? parseInt(match[1]) : undefined;
99
}
1010

1111
module.exports = {
12-
isIE: isIE,
12+
getIEVersion: getIEVersion,
1313
};

0 commit comments

Comments
 (0)