Commit 3047985b authored by Jérome Perrin's avatar Jérome Perrin

toolbox: add tooltip for node description

parent 647ae2b4
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
tools_container.className = 'tools-container'; tools_container.className = 'tools-container';
Object.keys(data.class_definition).forEach(function (key) { Object.keys(data.class_definition).forEach(function (key) {
var _class = data.class_definition[key], tool; var _class = data.class_definition[key], tool;
// XXX "expand" the json schema "allOF" etc // XXX "expand" the json schema "allOf" etc
if (_class._class === 'node') { if (_class._class === 'node') {
tool = document.createElement('div'); tool = document.createElement('div');
// XXX maybe allow to configure the class name ? // XXX maybe allow to configure the class name ?
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
tool.textContent = _class.name || key; tool.textContent = _class.name || key;
tool.draggable = true; tool.draggable = true;
tool.dataset.class_name = JSON.stringify(key); tool.dataset.class_name = JSON.stringify(key);
if (_class.description) {
tool.title = _class.description;
}
Object.keys(_class.css || {}).forEach(function (k) { Object.keys(_class.css || {}).forEach(function (k) {
tool.style[k] = _class.css[k]; tool.style[k] = _class.css[k];
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment