try to fix memory leaks
If the element is no longer in the DOM tree, stop its corresponding setInterval in the next cycle.
This commit is contained in:
parent
05a85b77f9
commit
b5a364d3a2
1 changed files with 7 additions and 0 deletions
|
@ -175,6 +175,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
|
//check if it's still visible
|
||||||
|
if(!$.contains(document.documentElement,this)){
|
||||||
|
//stop if it has been removed
|
||||||
|
$(this).timeago("dispose");
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
var data = prepareData(this);
|
var data = prepareData(this);
|
||||||
var $s = $t.settings;
|
var $s = $t.settings;
|
||||||
|
|
||||||
|
|
Reference in a new issue