diff --git a/plugin.js b/plugin.js index 39baccb..23eec3c 100644 --- a/plugin.js +++ b/plugin.js @@ -85,33 +85,10 @@ var cards = grid.find('.card.selector'); if (!cards.length) return; - // Native collection navigation: Lampa handles up/down/left/right - // over .selector elements automatically once the collection is set. + // Native collection navigation: Lampa handles up/down/left/right and + // fires "hover:enter" on the focused .selector when OK/Enter is pressed. Lampa.Controller.collectionSet(grid); Lampa.Controller.collectionFocus(cards[0], grid); - - // Custom controller only for enter/back while this screen is active. - Lampa.Controller.add('mymovies', { - toggle: function () { - var focused = grid.find('.card.selector.focus')[0] || cards[0]; - Lampa.Controller.collectionFocus(focused, grid); - }, - enter: function () { - var el = grid.find('.card.selector.focus')[0] || cards[0]; - if (el) { - var id = $(el).attr('data-id'); - var m = comp._movies ? comp._movies.find(function (x) { return x.id === id; }) : null; - if (m) openMovie(m); - } - }, - back: function () { - Lampa.Activity.back(); - }, - gone: function () { - Lampa.Controller.clear('mymovies'); - } - }); - Lampa.Controller.toggle('mymovies'); }; this.render = function () {