Skip to content

Commit 1d3cc91

Browse files
committed
style no webgl msg
1 parent a2a215e commit 1d3cc91

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/lib/show_no_webgl_msg.js

+14-4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,25 @@ module.exports = function showNoWebGlMsg(scene) {
3232

3333
var div = document.createElement('div');
3434
div.className = 'no-webgl';
35-
div.textContent = 'WebGL is not supported by your browser - visit https://get.webgl.org for more info';
3635
div.style.cursor = 'pointer';
3736
div.style.fontSize = '24px';
3837
div.style.color = Color.defaults[0];
3938
div.style.position = 'absolute';
40-
div.style.left = '20px';
41-
div.style.top = '50%';
39+
div.style.left = div.style.top = '0px';
4240
div.style.width = div.style.height = '100%';
43-
41+
div.style['background-color'] = Color.lightLine;
42+
div.style['z-index'] = 30;
43+
44+
var p = document.createElement('p');
45+
p.textContent = 'WebGL is not supported by your browser - visit https://get.webgl.org for more info';
46+
p.style.position = 'relative';
47+
p.style.top = '50%';
48+
p.style.left = '50%';
49+
p.style.height = '30%';
50+
p.style.width = '50%';
51+
p.style.margin = '-15% 0 0 -25%';
52+
53+
div.appendChild(p);
4454
scene.container.appendChild(div);
4555
scene.container.style.background = '#FFFFFF';
4656
scene.container.onclick = function() {

test/jasmine/bundle_tests/no_webgl_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('Plotly w/o WebGL support:', function() {
1717
});
1818

1919
function checkNoWebGLMsg(visible) {
20-
var msg = gd.querySelector('div.no-webgl');
20+
var msg = gd.querySelector('div.no-webgl > p');
2121
if(visible) {
2222
expect(msg.innerHTML.substr(0, 22)).toBe('WebGL is not supported');
2323
} else {

0 commit comments

Comments
 (0)