projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a5ad69c
)
fix some style bugs
author
Dan Vanderkam
<danvdk@gmail.com>
Tue, 14 Sep 2010 00:15:54 +0000
(17:15 -0700)
committer
Dan Vanderkam
<danvdk@gmail.com>
Tue, 14 Sep 2010 00:15:54 +0000
(17:15 -0700)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
e8afb2b
..
2c0e202
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-2363,7
+2363,19
@@
Dygraph.prototype.annotations = function() {
Dygraph.addAnnotationRule = function() {
if (Dygraph.addedAnnotationCSS) return;
Dygraph.addAnnotationRule = function() {
if (Dygraph.addedAnnotationCSS) return;
- var mysheet=document.styleSheets[0]
+ var mysheet;
+ if (document.styleSheets.length > 0) {
+ mysheet = document.styleSheets[0];
+ } else {
+ var styleSheetElement = document.createElement("style");
+ styleSheetElement.type = "text/css";
+ document.getElementsByTagName("head")[0].appendChild(styleSheetElement);
+ for(i = 0; i < document.styleSheets.length; i++) {
+ if (document.styleSheets[i].disabled) continue;
+ mysheet = document.styleSheets[i];
+ }
+ }
+
var rule = "border: 1px solid black; " +
"background-color: white; " +
"text-align: center;";
var rule = "border: 1px solid black; " +
"background-color: white; " +
"text-align: center;";