jquery data fn stopped working in infinite closet with campaign progress. fixed

This commit is contained in:
Emi Matchu 2011-07-11 10:58:30 -04:00
parent 7640369332
commit 06302336c5

View file

@ -107,7 +107,7 @@ function PetType() {
} }
} }
PetType.all = []; PetType.all = {};
PetType.LOAD_ERROR = new LoadError("$color_article $color $species"); PetType.LOAD_ERROR = new LoadError("$color_article $color $species");
PetType.DASH_REGEX = /-/g; PetType.DASH_REGEX = /-/g;
@ -120,7 +120,7 @@ PetType.createFromLink = function (link) {
} }
}); });
pet_type.link = link; pet_type.link = link;
PetType.all.push(pet_type); PetType.all[pet_type.id] = pet_type;
return pet_type; return pet_type;
} }
@ -248,10 +248,10 @@ PetType.createFromLink(speciesList.eq(Math.floor(Math.random()*speciesList.lengt
speciesList.each(function () { speciesList.each(function () {
var el = $(this); var el = $(this);
el.data('pet_type', PetType.createFromLink(el)); PetType.createFromLink(el);
}).live('click', function (e) { }).live('click', function (e) {
e.preventDefault(); e.preventDefault();
$(this).data('pet_type').setAsCurrent(); PetType.all[$(this).data('id')].setAsCurrent();
}); });
setTimeout($.proxy(Item.current, 'loadAllStandard'), 5000); setTimeout($.proxy(Item.current, 'loadAllStandard'), 5000);
@ -259,3 +259,4 @@ setTimeout($.proxy(Item.current, 'loadAllStandard'), 5000);
window.MainWardrobe = {View: {Outfit: {setFlashIsReady: previewSWFIsReady}}} window.MainWardrobe = {View: {Outfit: {setFlashIsReady: previewSWFIsReady}}}
var SWFLog = $.noop; var SWFLog = $.noop;