Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't activate timeago on elements prior to inserting them into the DOM #198

Open
jhass opened this issue Oct 14, 2014 · 3 comments
Open

Comments

@jhass
Copy link

jhass commented Oct 14, 2014

Opening issue since no reaction to #190 (comment)

@rmm5t
Copy link
Owner

rmm5t commented Dec 24, 2014

Yes, this is true, and an unfortunate limitation of Timeago. I've had long-time plans to write Timeago 2 to help solve these issues, but time keeps escaping me. I'm also hesitant to pull-in related PRs, because of the rewrite that's still in my head.

For now, you need to call timeago() on new elements after they've been inserted into the DOM.

However, if an element is removed from the DOM, timeago automatically handles this and disposes of it on the next cycle.

@kevin-brown
Copy link

Just pointing out that this was made in b5a364d, so downgrading to 1.4.0 does fix the issue.

We were recently hit by this issue when we decided to upgrade timeago.

@rmm5t
Copy link
Owner

rmm5t commented Mar 2, 2015

@kevin-brown Thanks for the extra info. That helps me understand the underlying issue better.

b5a364d had some importance, so if there are any ideas about how to keep that working but also improve the scenario reported here, I'm open to reviewing a PR.

hughdavenport pushed a commit to hughdavenport/websockets-dashboard that referenced this issue May 19, 2015
rmm5t/jquery-timeago#190 fixed a memory leak
with the timeago plugin, so upgrade to that.

That created a small issue
rmm5t/jquery-timeago#198 where you had to
initialise timeago AFTER adding it to the DOM, otherwise it would
dispose of it before it worked.

This should fix majority of memory leaks still remaining.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants