projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
jquery-ify the palette object.
[dygraphs.git]
/
experimental
/
palette
/
tooltip.js
diff --git
a/experimental/palette/tooltip.js
b/experimental/palette/tooltip.js
index
20479b0
..
a1d8856
100644
(file)
--- a/
experimental/palette/tooltip.js
+++ b/
experimental/palette/tooltip.js
@@
-29,17
+29,26
@@
function Tooltip(parent) {
if (!parent) {
parent = document.getElementsByTagName("body")[0];
}
if (!parent) {
parent = document.getElementsByTagName("body")[0];
}
- this.elem =
Palette
.createChild("div", parent);
- this.title =
Palette
.createChild("div", this.elem);
+ this.elem =
Tooltip
.createChild("div", parent);
+ this.title =
Tooltip
.createChild("div", this.elem);
this.elem.className = "tooltip";
this.title.className = "title";
this.elem.className = "tooltip";
this.title.className = "title";
- this.type =
Palette
.createChild("div", this.elem);
+ this.type =
Tooltip
.createChild("div", this.elem);
this.type.className = "type";
this.type.className = "type";
- this.body =
Palette
.createChild("div", this.elem);
+ this.body =
Tooltip
.createChild("div", this.elem);
this.body.className = "body";
this.hide();
}
this.body.className = "body";
this.hide();
}
+Tooltip.createChild = function(type, parentElement, className) {
+ var element = document.createElement(type);
+ parentElement.appendChild(element);
+ if (className) {
+ element.className = className;
+ }
+ return element;
+};
+
Tooltip.prototype.show = function(source, title, type, body) {
this.title.innerHTML = title;
this.body.innerHTML = body;
Tooltip.prototype.show = function(source, title, type, body) {
this.title.innerHTML = title;
this.body.innerHTML = body;