Closed sinisterchipmunk closed 11 years ago
FYI, this appears to work (from the console at least) as a workaround until this issue is fixed:
c = new Jax.Context({renderers: []}); // note we leave canvas out
c.canvas = document.body;
c.setupInputDevices();
c.redirectTo("controller/path");
This approach worked with controller methods and events; I did not test views.
It should be possible to explicitly create a context without a renderer, and even attach it to a non-canvas element. The following should work:
But instead it fails with:
Interesting to note, if you follow the stack trace, the
renderer
reference is actually a bug in itself: inside ofJax.Renderer.attemptThese
, whereRenderer
is a string instead of a function, the reference torenderer
should beRenderer
. However, even if this code worked,attemptThese
would ultimately produce an error message complaining that no renderer could be instantiated.We want to keep the existing error in the event that the specified renderers could not be loaded. So, the answer is to check the length of the requested renderer array one step back, in
Jax.Context
, and specifically skip renderer initialization if the array is empty.Something to test: the above code should work just like any other Jax context, except that no rendering should be produce. For example, it should still register event listeners, fire controller methods, and execute views.