arturadib/agility — Issue #69: Agility and Raphael don't like each other....
Author: abdielou
Created: 2012-01-20 16:12:53+00:00
State: open

I'm not sure if this is a problem with Agility or Raphael or it's just that "Javascript - DOM" programming sucks. Here's the scenario:
1- I have Agility object A.
2- object A contains a div with id='r'
3- on 'create', object A creates a Raphael object by feeding Raphael with this.view.$('#r')[0]. Raphael creates an object and gives it a transparent gradient.
4- object A is added to the document by $$.document.append(A)

Result: the gradient is not shown.
Why: Raphael creates the gradient objects in the window.document, not in $$.document which lives in memory.
Work Around: create the Raphael object after step #4, not at step #3. this way, every agility object will already live in the DOM.