Hi Rien Rien

> Is there a mean to detect that a tiddler is about to close (in widget's
code) ?

No, I'm afraid there is currently no way for a widget to be notified that
it is being deleted.

In your timer callback, you should be able to check whether the widgets DOM
nodes are still in the document, and disable the timer if they are not.

Best wishes

Jeremy











On Sun, Dec 7, 2014 at 6:00 PM, Rien Rien <[email protected]> wrote:

> Hi,
>
> Is there a mean to detect that a tiddler is about to close (in widget's
> code) ?
> In my widget, there is an animation with a periodic function launched
> every xx ms with setTimeout or with requestAnimationFrame().
> I would like to stop that function when tiddler closes, to free CPU if
> function is heavy or numerous widget instances. Ideally with an event
> listner.
>
> Thanks
> --
> Lebrun
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to