fix homepage JS

main name field lost its ID in the redesign
gave it one and changed the one in the JS to match
This commit is contained in:
Emi Matchu 2010-11-07 17:19:47 -05:00
parent 7db0beec75
commit b44cb4b09e
3 changed files with 6 additions and 5 deletions

View file

@ -8,7 +8,8 @@ module OutfitsHelper
options_from_collection_for_select(collection, :id, :human_name, value)
end
def pet_name_tag
text_field_tag 'name', nil, :spellcheck => false, :id => nil
def pet_name_tag(options={})
options = {:spellcheck => false, :id => nil}.merge(options)
text_field_tag 'name', nil, options
end
end

View file

@ -1,6 +1,6 @@
#outfit-forms
#pet-preview
= image_tag 'default_preview.png'
= image_tag 'default_preview.png', :alt => ''
%span
%h1 Dress to Impress
%h2 Neopets wearables made easy!
@ -9,7 +9,7 @@
= destination_tag 'wardrobe'
%fieldset
%legend Enter your pet's name
= pet_name_tag
= pet_name_tag :id => 'main-pet-name'
%button{:type => "submit"}
Plan my outfit!
= form_tag wardrobe_path, :method => 'get', :id => 'start-from-scratch' do

View file

@ -3,7 +3,7 @@
var preview_el = $('#pet-preview'),
img_el = preview_el.find('img'),
response_el = preview_el.find('span'),
name_el = $('#name');
name_el = $('#main-pet-name');
preview_el.click(function () {
name_el.val(Preview.Job.current.name).closest('form').submit();