forked from 0x2620/oxjs
Ox.elements -> Ox.
This commit is contained in:
parent
775aa607c8
commit
8e335ba4f6
8 changed files with 21 additions and 21 deletions
|
|
@ -12,17 +12,17 @@ Ox.GarbageCollection = (function() {
|
|||
timeout;
|
||||
|
||||
that.collect = function() {
|
||||
var len = Ox.len(Ox.elements);
|
||||
Object.keys(Ox.elements).forEach(function(id) {
|
||||
var $element = Ox.elements[id];
|
||||
var len = Ox.len(Ox.$elements);
|
||||
Object.keys(Ox.$elements).forEach(function(id) {
|
||||
var $element = Ox.$elements[id];
|
||||
if ($element && Ox.isUndefined($element.data('oxid'))) {
|
||||
$element.remove();
|
||||
delete Ox.elements[id];
|
||||
delete Ox.$elements[id];
|
||||
}
|
||||
});
|
||||
timeout && clearTimeout(timeout);
|
||||
timeout = setTimeout(that.collect, 60000);
|
||||
Ox.Log('GC', len, '-->', Ox.len(Ox.elements));
|
||||
Ox.Log('GC', len, '-->', Ox.len(Ox.$elements));
|
||||
};
|
||||
|
||||
/*@
|
||||
|
|
@ -31,7 +31,7 @@ Ox.GarbageCollection = (function() {
|
|||
@*/
|
||||
that.debug = function() {
|
||||
var classNames = {}, sorted = [];
|
||||
Ox.forEach(Ox.elements, function($element, id) {
|
||||
Ox.forEach(Ox.$elements, function($element, id) {
|
||||
var className = $element[0].className;
|
||||
classNames[className] = (classNames[className] || 0) + 1;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue