Repair graph editor
graph_editor was using rsvp.Monitor
in order to dynamically add new promises to the chain of promise in its declareService
promise. New DOM elements were added during gadget's lifetime and and event handler on these new elements was added to the chain of promise by using monitor method of a monitor instance which was returned in declareService
.
rsvp.js
included in erp5_xhml_style
exported Monitor
, but this was removed in af9c57db . If I understand correctly, this is now included in renderjs, but it's only internal.
So this old way of doing is not longer possible. We realized that instead of dynamically setting dblclick
event handlers to each graph node elements, we could simply rely on event bubbling and use a event handler on the parent DOM element. Also, we used renderjs builtin onEvent
that makes event callback function executed in the promise chain .
At this stage we did not try to switch all event handling to this approach of using a "global" event handler on the parent DOM, because the goal here was just repairing the graph editor and making sure we have tests running. Also jsplumb uses its own event system.
To enable tests for this:
- Running the existing qunit test through Zelenium. As far as I know we cannot run qunit test as part of ERP5 test suite.
- Install the business template in testXHTML so that it is tested by
jsl
, which by the way produce different messages that the jshint integrated in ERP5's code mirror and jslint fromWebScript_checkSyntax
. For now, this passes jshint and jsl, but jslint complains about some indentation and space problems.