whoops, we broke start from scratch previews when neopia is online xP
(I wonder why nobody noticed ;P)
This commit is contained in:
parent
647c767c31
commit
8e83adabbd
2 changed files with 10 additions and 10 deletions
|
@ -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']);
|
Preview.Job.apply(this, [hash, 'cp']);
|
||||||
|
|
||||||
this.visit = function() {
|
this.visit = function() {
|
||||||
window.location = "/wardrobe?color=" + $('#color').val() + "&species=" +
|
window.location = "/wardrobe?color=" + form.find('.color').val() + "&species=" +
|
||||||
$('#species').val();
|
form.find('.species').val();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,11 +181,11 @@ $(function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var selectFields = $('#species, #color');
|
$('.species, .color').change(function () {
|
||||||
selectFields.change(function () {
|
|
||||||
var type = {}, nameComponents = {};
|
var type = {}, nameComponents = {};
|
||||||
selectFields.each(function () {
|
var form = $(this).closest('form');
|
||||||
var el = $(this), selectedEl = el.children(':selected'), key = el.attr('id');
|
form.find('select').each(function () {
|
||||||
|
var el = $(this), selectedEl = el.children(':selected'), key = el.attr('name');
|
||||||
type[key] = selectedEl.val();
|
type[key] = selectedEl.val();
|
||||||
nameComponents[key] = selectedEl.text();
|
nameComponents[key] = selectedEl.text();
|
||||||
});
|
});
|
||||||
|
@ -200,7 +200,7 @@ $(function () {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var job;
|
var job;
|
||||||
if(data) {
|
if(data) {
|
||||||
job = new Preview.Job.Hash(data.image_hash);
|
job = new Preview.Job.Hash(data.image_hash, form);
|
||||||
job.name = name;
|
job.name = name;
|
||||||
job.setAsCurrent();
|
job.setAsCurrent();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -106,8 +106,8 @@ module OutfitsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def pet_attribute_select(name, collection, value=nil)
|
def pet_attribute_select(name, collection, value=nil)
|
||||||
select_tag name,
|
options = options_from_collection_for_select(collection, :id, :human_name, value)
|
||||||
options_from_collection_for_select(collection, :id, :human_name, value)
|
select_tag name, options, id: nil, class: name
|
||||||
end
|
end
|
||||||
|
|
||||||
def pet_name_tag(options={})
|
def pet_name_tag(options={})
|
||||||
|
|
Loading…
Reference in a new issue