forked from OpenNeo/impress
lolwhoops, make nebula previews clickable - and all pet type previews for that matter
This commit is contained in:
parent
f9fa3eb596
commit
4532ecccd5
1 changed files with 10 additions and 1 deletions
|
@ -8,7 +8,7 @@ var preview_el = $('#pet-preview'),
|
||||||
name_el = $('#main-pet-name');
|
name_el = $('#main-pet-name');
|
||||||
|
|
||||||
preview_el.click(function () {
|
preview_el.click(function () {
|
||||||
name_el.val(Preview.Job.current.name).closest('form').submit();
|
Preview.Job.current.visit();
|
||||||
});
|
});
|
||||||
|
|
||||||
var Preview = {
|
var Preview = {
|
||||||
|
@ -87,10 +87,19 @@ Preview.Job = function (key, base) {
|
||||||
Preview.Job.Name = function (name) {
|
Preview.Job.Name = function (name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
Preview.Job.apply(this, [name, 'cpn']);
|
Preview.Job.apply(this, [name, 'cpn']);
|
||||||
|
|
||||||
|
this.visit = function() {
|
||||||
|
name_el.val(this.name).closest('form').submit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Preview.Job.Hash = function (hash) {
|
Preview.Job.Hash = function (hash) {
|
||||||
Preview.Job.apply(this, [hash, 'cp']);
|
Preview.Job.apply(this, [hash, 'cp']);
|
||||||
|
|
||||||
|
this.visit = function() {
|
||||||
|
window.location = "/wardrobe?color=" + $('#color').val() + "&species=" +
|
||||||
|
$('#species').val();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue