1
0
Fork 0
forked from OpenNeo/impress

lolwhoops, make nebula previews clickable - and all pet type previews for that matter

This commit is contained in:
Emi Matchu 2014-03-31 23:07:55 -05:00
parent f9fa3eb596
commit 4532ecccd5

View file

@ -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();
}
} }