2015-06-24 05:09:16 +00:00
|
|
|
var cards = require("../../../../../../assets/data/cards");
|
|
|
|
var deck = require("../../../../../../assets/data/deck");
|
|
|
|
|
2015-06-23 08:36:29 +00:00
|
|
|
module.exports = {
|
|
|
|
|
2015-06-24 05:09:16 +00:00
|
|
|
template: require('../views/deck-builder.html'),
|
|
|
|
|
|
|
|
data: function() {
|
|
|
|
return {
|
|
|
|
cards: [],
|
2015-06-24 10:44:10 +00:00
|
|
|
deck: [],
|
|
|
|
|
|
|
|
leaders: [],
|
|
|
|
leader: null,
|
|
|
|
|
2015-06-24 13:21:17 +00:00
|
|
|
factionFilter: 'northern_realm'
|
2015-06-24 05:09:16 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
ready: function() {
|
2015-06-24 15:51:21 +00:00
|
|
|
// filter over leaders and store them separately.
|
|
|
|
this.cards = $.map(cards, (n) => {
|
|
|
|
if(n.type != 3) return n;
|
|
|
|
|
|
|
|
this.leaders.push(n);
|
|
|
|
});
|
2015-06-24 10:44:10 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
changeDeck: function(deck) {
|
2015-06-24 13:21:17 +00:00
|
|
|
// todo: load animation
|
2015-06-24 10:44:10 +00:00
|
|
|
$('.all-cards').addClass('remove');
|
|
|
|
this.factionFilter = deck;
|
|
|
|
$('.all-cards').scrollTop(0);
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
$('.all-cards').removeClass('remove');
|
2015-06-24 15:51:21 +00:00
|
|
|
}, 500);
|
2015-06-24 10:44:10 +00:00
|
|
|
}
|
2015-06-24 05:09:16 +00:00
|
|
|
}
|
2015-06-23 08:36:29 +00:00
|
|
|
};
|