Fix a bug in the component loader that caused components to be loaded multiple times

refs # 4456
This commit is contained in:
Matthias Jentsch 2013-08-20 19:09:07 +02:00 committed by Marius Hein
parent 61fad6b89c
commit 889abf55eb

View File

@ -81,6 +81,8 @@ define(['jquery', 'logging', 'icinga/componentRegistry'], function ($, log, regi
.each(function(index, el) {
var type = $(el).attr('data-icinga-component');
pendingFns++;
if (!el.id || !registry.getById(el.id)) {
loadComponent(
type,
el,
@ -92,6 +94,10 @@ define(['jquery', 'logging', 'icinga/componentRegistry'], function ($, log, regi
},
finalize
);
} else {
registry.markActive(el.id);
finalize();
}
});
finalize();
};