1
0
Fork 0
forked from OpenNeo/impress

whoops, we broke start from scratch previews when neopia is online xP

(I wonder why nobody noticed ;P)
This commit is contained in:
Matchu 2015-07-16 22:37:04 -04:00
parent 647c767c31
commit 8e83adabbd
2 changed files with 10 additions and 10 deletions

View file

@ -120,12 +120,12 @@ Preview.Job.Name = function (name) {
}
}
Preview.Job.Hash = function (hash) {
Preview.Job.Hash = function (hash, form) {
Preview.Job.apply(this, [hash, 'cp']);
this.visit = function() {
window.location = "/wardrobe?color=" + $('#color').val() + "&species=" +
$('#species').val();
window.location = "/wardrobe?color=" + form.find('.color').val() + "&species=" +
form.find('.species').val();
}
}
@ -181,11 +181,11 @@ $(function () {
}
});
var selectFields = $('#species, #color');
selectFields.change(function () {
$('.species, .color').change(function () {
var type = {}, nameComponents = {};
selectFields.each(function () {
var el = $(this), selectedEl = el.children(':selected'), key = el.attr('id');
var form = $(this).closest('form');
form.find('select').each(function () {
var el = $(this), selectedEl = el.children(':selected'), key = el.attr('name');
type[key] = selectedEl.val();
nameComponents[key] = selectedEl.text();
});
@ -200,7 +200,7 @@ $(function () {
success: function (data) {
var job;
if(data) {
job = new Preview.Job.Hash(data.image_hash);
job = new Preview.Job.Hash(data.image_hash, form);
job.name = name;
job.setAsCurrent();
} else {

View file

@ -106,8 +106,8 @@ module OutfitsHelper
end
def pet_attribute_select(name, collection, value=nil)
select_tag name,
options_from_collection_for_select(collection, :id, :human_name, value)
options = options_from_collection_for_select(collection, :id, :human_name, value)
select_tag name, options, id: nil, class: name
end
def pet_name_tag(options={})