Simplified component-creation, dropping IE8 compatibility.

This commit is contained in:
FrozenCow 2011-03-31 12:54:32 +02:00
parent 6eface57ae
commit 6622db1b2c
5 changed files with 173 additions and 192 deletions

View file

@ -280,10 +280,8 @@ DynMap.prototype = {
me.selectMap(me.defaultworld.defaultmap);
$.each(me.options.components, function(index, configuration) {
me.components.push(componentconstructors[configuration.type](me, configuration));
});
$.each(me.components, function(index, component) {
component.initialize();
var componentconstructor = componentconstructors[configuration.type];
me.components.push(new componentconstructor(me, configuration));
});
setTimeout(function() { me.update(); }, me.options.updaterate);