Added popovers to team preview
This commit is contained in:
parent
b7230033bb
commit
27a571328b
|
@ -207,7 +207,13 @@ class @BattleView extends Backbone.View
|
||||||
locals =
|
locals =
|
||||||
battle : @model
|
battle : @model
|
||||||
window : window
|
window : window
|
||||||
|
yourTeam : @model.getTeam()
|
||||||
@$('.battle_container').append @team_preview_template(locals)
|
@$('.battle_container').append @team_preview_template(locals)
|
||||||
|
@$('.battle_teams').find('.arrange_team .pokemon_icon').each (i, el) =>
|
||||||
|
$this = $(el)
|
||||||
|
slot = $this.data('index')
|
||||||
|
pokemon = @model.getPokemon(@model.get('index'), slot)
|
||||||
|
@pokemonPopover($this, pokemon)
|
||||||
|
|
||||||
togglePokemonOrSwitch: (e) =>
|
togglePokemonOrSwitch: (e) =>
|
||||||
$currentTarget = $(e.currentTarget)
|
$currentTarget = $(e.currentTarget)
|
||||||
|
|
|
@ -3256,9 +3256,19 @@
|
||||||
var locals;
|
var locals;
|
||||||
locals = {
|
locals = {
|
||||||
battle: this.model,
|
battle: this.model,
|
||||||
window: window
|
window: window,
|
||||||
|
yourTeam: this.model.getTeam()
|
||||||
};
|
};
|
||||||
return this.$('.battle_container').append(this.team_preview_template(locals));
|
this.$('.battle_container').append(this.team_preview_template(locals));
|
||||||
|
return this.$('.battle_teams').find('.arrange_team .pokemon_icon').each((function(_this) {
|
||||||
|
return function(i, el) {
|
||||||
|
var $this, pokemon, slot;
|
||||||
|
$this = $(el);
|
||||||
|
slot = $this.data('index');
|
||||||
|
pokemon = _this.model.getPokemon(_this.model.get('index'), slot);
|
||||||
|
return _this.pokemonPopover($this, pokemon);
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
BattleView.prototype.togglePokemonOrSwitch = function(e) {
|
BattleView.prototype.togglePokemonOrSwitch = function(e) {
|
||||||
|
|
|
@ -2982,9 +2982,19 @@
|
||||||
var locals;
|
var locals;
|
||||||
locals = {
|
locals = {
|
||||||
battle: this.model,
|
battle: this.model,
|
||||||
window: window
|
window: window,
|
||||||
|
yourTeam: this.model.getTeam()
|
||||||
};
|
};
|
||||||
return this.$('.battle_container').append(this.team_preview_template(locals));
|
this.$('.battle_container').append(this.team_preview_template(locals));
|
||||||
|
return this.$('.battle_teams').find('.arrange_team .pokemon_icon').each((function(_this) {
|
||||||
|
return function(i, el) {
|
||||||
|
var $this, pokemon, slot;
|
||||||
|
$this = $(el);
|
||||||
|
slot = $this.data('index');
|
||||||
|
pokemon = _this.model.getPokemon(_this.model.get('index'), slot);
|
||||||
|
return _this.pokemonPopover($this, pokemon);
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
BattleView.prototype.togglePokemonOrSwitch = function(e) {
|
BattleView.prototype.togglePokemonOrSwitch = function(e) {
|
||||||
|
|
Loading…
Reference in New Issue