| Summary: | orion.edit.outliner service does not support multiple CSS classes | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Andrew Eisenberg <andrew.eisenberg> |
| Component: | Editor | Assignee: | Mark Macdonald <mamacdon> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public, mamacdon |
| Version: | unspecified | ||
| Target Milestone: | 5.0 M2 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
|
Description
Andrew Eisenberg
Here is the plugin I am using: <!DOCTYPE html> <html> <head> <title>Foo bar List</title> <script type="text/javascript" src="http://orion.eclipse.org/orion/plugin.js"></script> <script type="text/javascript" src="http://orion.eclipse.org/requirejs/require.js"></script> <script> /*global eclipse require */ require(["http://orion.eclipse.org/orion/Deferred.js"], function(Deferred) { var transformResults = function transformResults(results) { return results.map(function(item) { return { label : item.displayName, href: item.link, className: item.tasks ? "footerBlock progressNormal" : null, // problem is here!!!!! children: item.tasks ? transformResults(item.tasks) : null }; }); }; var headers = { name: "Foobar List", version: "0.1", description: "Provides a Foobar List for Orion." }; var provider = new orion.PluginProvider(headers); var impl = function(editorContext, options) { var deferred = new Deferred(); var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { deferred.resolve(transformResults(JSON.parse(xhr.responseText))); } } xhr.open('GET', '/data/'); xhr.send(); return deferred; }; var serviceImpl = { computeOutline: impl }; var serviceProperties = { name: "Foobar", contentType: ["text/plain"], id: ["foo.bar.outline"] }; provider.registerService("orion.edit.outliner", serviceImpl, serviceProperties); provider.connect(); }); </script> </head> <body> <p>Provides a foobar outliner.</p> </body> </html> Should be fixed now. Wherever we allow services to provide a class name, we should allow for multiple class names too. This means the implementation should sue element.className += whatever and not element.classList.add(whatever) The classList.add() function only takes a single class in most browsers. |