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

Commit 9d7b55a

Browse files
committed
Add fallback IE styles
1 parent 1f75f5b commit 9d7b55a

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

src/Styles.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const Radium = require('radium');
2+
const Util = require('./Util');
23
const toolbarHeight = '50px';
34

45
const closeWindowKeyframes = Radium.keyframes({
@@ -198,4 +199,37 @@ const styles = {
198199
},
199200
};
200201

202+
// Use fallback styles for IE users
203+
if (Util.isIE()) {
204+
styles.toolbar = {
205+
backgroundColor : 'rgba(0, 0, 0, 0.5)',
206+
position : 'absolute',
207+
left : 0,
208+
top : 0,
209+
right : 0,
210+
height : toolbarHeight,
211+
};
212+
213+
styles.toolbarSide = {
214+
lineHeight : toolbarHeight,
215+
position : 'absolute',
216+
top : 0,
217+
bottom : 0,
218+
margin : 0,
219+
maxWidth : '48%',
220+
};
221+
222+
styles.toolbarLeftSide = {
223+
paddingLeft : '20px',
224+
paddingRight : 0,
225+
left : 0,
226+
};
227+
228+
styles.toolbarRightSide = {
229+
paddingLeft : 0,
230+
paddingRight : '20px',
231+
right : 0,
232+
};
233+
}
234+
201235
module.exports = styles;

src/Util.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Checks if the user is using Internet Explorer
3+
*
4+
* @return {boolean} isIE - True if the user is on IE
5+
*/
6+
function isIE() {
7+
var ua = window.navigator.userAgent;
8+
return ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1;
9+
}
10+
11+
module.exports = {
12+
isIE: isIE,
13+
};

0 commit comments

Comments
 (0)