Made getpokedexurl link to the pokemon page, made clicking a pokemon in the tiers page open a pokemon page in a new tab
This commit is contained in:
parent
ff1867b5af
commit
d8c4a3067b
|
@ -268,7 +268,7 @@ class @Pokemon extends Backbone.Model
|
||||||
|
|
||||||
slugSpecies = slugify(@get('species'))
|
slugSpecies = slugify(@get('species'))
|
||||||
slugForme = slugify(@get('forme'))
|
slugForme = slugify(@get('forme'))
|
||||||
"//wiki.p-insurgence.com/#{slugSpecies}"
|
"/pokemon/#{@get('species')}"
|
||||||
|
|
||||||
getIllu: ->
|
getIllu: ->
|
||||||
@get('illu')
|
@get('illu')
|
||||||
|
|
|
@ -28,6 +28,7 @@ style
|
||||||
height: 200px;
|
height: 200px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.description{
|
.description{
|
||||||
width: 400px;
|
width: 400px;
|
||||||
|
|
|
@ -1876,7 +1876,7 @@
|
||||||
};
|
};
|
||||||
slugSpecies = slugify(this.get('species'));
|
slugSpecies = slugify(this.get('species'));
|
||||||
slugForme = slugify(this.get('forme'));
|
slugForme = slugify(this.get('forme'));
|
||||||
return "//wiki.p-insurgence.com/" + slugSpecies;
|
return "/pokemon/" + (this.get('species'));
|
||||||
};
|
};
|
||||||
|
|
||||||
Pokemon.prototype.getIllu = function() {
|
Pokemon.prototype.getIllu = function() {
|
||||||
|
|
|
@ -1876,7 +1876,7 @@
|
||||||
};
|
};
|
||||||
slugSpecies = slugify(this.get('species'));
|
slugSpecies = slugify(this.get('species'));
|
||||||
slugForme = slugify(this.get('forme'));
|
slugForme = slugify(this.get('forme'));
|
||||||
return "//wiki.p-insurgence.com/" + slugSpecies;
|
return "/pokemon/" + (this.get('species'));
|
||||||
};
|
};
|
||||||
|
|
||||||
Pokemon.prototype.getIllu = function() {
|
Pokemon.prototype.getIllu = function() {
|
||||||
|
|
|
@ -190,7 +190,8 @@ function populateTable(arr) {
|
||||||
for (var i in arr) {
|
for (var i in arr) {
|
||||||
var pokeObj = arr[i];
|
var pokeObj = arr[i];
|
||||||
var row = table.insertRow(-1);
|
var row = table.insertRow(-1);
|
||||||
row.className += "row"
|
row.className += "row pokemonRow"
|
||||||
|
row.id = pokeObj.name
|
||||||
// Sets dexNo
|
// Sets dexNo
|
||||||
var dexcell = row.insertCell(0);
|
var dexcell = row.insertCell(0);
|
||||||
dexcell.innerHTML = pokeObj.id;
|
dexcell.innerHTML = pokeObj.id;
|
||||||
|
@ -290,6 +291,33 @@ function populateTable(arr) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openTab(pkmn) {
|
||||||
|
pkmn = pkmn.replace(" ", "_")
|
||||||
|
url= "/pokemon/" + pkmn
|
||||||
|
window.open(url, '_blank');
|
||||||
|
}
|
||||||
|
|
||||||
|
$("table.table.list").click(function (e) {
|
||||||
|
target = e.target;
|
||||||
|
var search = target;
|
||||||
|
var searching = true;
|
||||||
|
while (searching) {
|
||||||
|
upNode = search.parentElement;
|
||||||
|
if (upNode.localName == "body") {
|
||||||
|
searching = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (upNode.className == "row pokemonRow") {
|
||||||
|
searching = false;
|
||||||
|
openTab(upNode.id)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
search = upNode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
makeObject(function (arr) {
|
makeObject(function (arr) {
|
||||||
populateTable(arr)
|
populateTable(arr)
|
||||||
|
|
Loading…
Reference in New Issue