diff options
| author | Teddy Wing | 2013-04-28 12:21:11 -0400 |
|---|---|---|
| committer | Teddy Wing | 2013-04-28 12:21:11 -0400 |
| commit | e345c618b1c9b2f9301c794defdf36b0f7d6d676 (patch) | |
| tree | fcce2712c40271f70efa196d50855ac4b5cf047b /public/javascripts/app.js | |
| parent | cf5c3a783a25a5a094be82b41cd66988c073df80 (diff) | |
| download | Who-am-I-e345c618b1c9b2f9301c794defdf36b0f7d6d676.tar.bz2 | |
Fix bugs with character fetch
Diffstat (limited to 'public/javascripts/app.js')
| -rw-r--r-- | public/javascripts/app.js | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/public/javascripts/app.js b/public/javascripts/app.js index c54651a..f78b204 100644 --- a/public/javascripts/app.js +++ b/public/javascripts/app.js @@ -2,26 +2,32 @@ var App = App || null; (function() { var cApp = function() { - this.characters = null; + this.characters = []; this.answer = null; + this.playlist = [] // CoverFlow var initialise_js_cover_flow = function(playlist) { + var that = this; coverflow('character-select-container').setup({ width: '100%', playlist: playlist, coverheight: 130, textoffset: 68 }).on('ready', function() { - this.on('click', function() { - alert('chosen'); + var the_other = that; + this.on('click', function(e) { +// if (the_other.answer == + console.log(e); + var selection = this.playlist[e]; +// alert('chosen'); }); }); }; this.initialize_video = function(url) { - + console.log(url); }; this.get_characters = function(series_id) { @@ -34,17 +40,19 @@ var App = App || null; var r = JSON.parse(response); $character_container.empty() - - var playlist = [] + for (var i = 0; i < r.characters.length; i++) { - playlist.push({ + that.playlist.push({ image: r.characters[i].image, title: r.characters[i].name }); + + that.characters.push({ + personId: r.characters[i].tms_personId, + name: r.characters[i].name + }); } - initialise_js_cover_flow(playlist); - - that.characters = _.pluck(r.characters, 'tms_personId'); + initialise_js_cover_flow(that.playlist); } ); }; |
