From: Josep Llodrà€ Date: Fri, 24 Feb 2012 12:01:11 +0000 (+0100) Subject: Prevent crashing when using unsupported css3 properties for your browser in labelsDiv... X-Git-Tag: v1.0.0~314^2~18^2~2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=623bbb49afcf438fcba59d1c7db6ab8c537c961e;p=dygraphs.git Prevent crashing when using unsupported css3 properties for your browser in labelsDivStyles --- diff --git a/dygraph.js b/dygraph.js index 0748d26..fed1cf4 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1002,9 +1002,11 @@ Dygraph.prototype.createStatusMessage_ = function() { var div = document.createElement("div"); div.className = "dygraph-legend"; for (var name in messagestyle) { - if (messagestyle.hasOwnProperty(name)) { - div.style[name] = messagestyle[name]; - } + try { + div.style[name] = messagestyle[name]; + } catch (e) { + console.warn("You are using unsupported css properties for your browser in labelsDivStyles"); + } } this.graphDiv.appendChild(div); this.attrs_.labelsDiv = div; diff --git a/tests/customLabelCss3.html b/tests/customLabelCss3.html new file mode 100644 index 0000000..c90af5f --- /dev/null +++ b/tests/customLabelCss3.html @@ -0,0 +1,41 @@ + + + + + Label styles + + + + + + + +

Labels are styled with css3:

+
+ + + +