forked from 0x2620/oxjs
Ox.UI.elements -> Ox.elements
This commit is contained in:
parent
2d8d88b218
commit
0b5f8f9492
5 changed files with 11 additions and 10 deletions
|
|
@ -16,17 +16,17 @@ Ox.GarbageCollection = (function() {
|
|||
collect();
|
||||
|
||||
function collect() {
|
||||
var len = Ox.len(Ox.UI.elements);
|
||||
Object.keys(Ox.UI.elements).forEach(function(id) {
|
||||
var $element = Ox.UI.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.UI.elements[id];
|
||||
delete Ox.elements[id];
|
||||
}
|
||||
});
|
||||
timeout && clearTimeout(timeout);
|
||||
timeout = setTimeout(collect, 60000);
|
||||
Ox.Log('GC', len, '-->', Ox.len(Ox.UI.elements));
|
||||
Ox.Log('GC', len, '-->', Ox.len(Ox.elements));
|
||||
}
|
||||
|
||||
/*@
|
||||
|
|
@ -35,7 +35,7 @@ Ox.GarbageCollection = (function() {
|
|||
@*/
|
||||
that.debug = function() {
|
||||
var classNames = {}, sorted = [];
|
||||
Ox.forEach(Ox.UI.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