update current species name
This commit is contained in:
parent
d4b65ecf62
commit
ecacb44153
2 changed files with 21 additions and 2 deletions
|
@ -1286,6 +1286,26 @@ View.Search = function (wardrobe) {
|
|||
if ($('meta[name=user-signed-in]').attr('content') === 'true') {
|
||||
wrapper.find('li.must-log-in input').removeAttr('disabled');
|
||||
}
|
||||
|
||||
var speciesNamesById = null;
|
||||
|
||||
function updateCurrentSpeciesName() {
|
||||
if (speciesNamesById !== null) {
|
||||
var speciesId = wardrobe.outfits.getPetType().species_id;
|
||||
var speciesName = speciesNamesById[speciesId];
|
||||
$('label[for=advanced-search-species] span').text(speciesName);
|
||||
}
|
||||
}
|
||||
|
||||
wardrobe.pet_attributes.bind('update', function(petAttributes) {
|
||||
speciesNamesById = {};
|
||||
petAttributes.species.forEach(function(species) {
|
||||
speciesNamesById[species.id] = species.name;
|
||||
});
|
||||
updateCurrentSpeciesName();
|
||||
});
|
||||
|
||||
wardrobe.outfits.bind('updatePetType', updateCurrentSpeciesName);
|
||||
}
|
||||
|
||||
View.PrankColorMessage = function(wardrobe) {
|
||||
|
|
|
@ -145,8 +145,7 @@
|
|||
%input{type: 'checkbox', id: 'advanced-search-species'}
|
||||
%label{for: 'advanced-search-species'}
|
||||
Fits the
|
||||
-# TODO: update to current species
|
||||
%span Acara
|
||||
%span
|
||||
(the current species)
|
||||
%li.checkbox.must-log-in
|
||||
%input{type: 'checkbox', id: 'advanced-search-owns', disabled: true}
|
||||
|
|
Loading…
Reference in a new issue