From 7d0c69f99581488c863369d7d887b43509db4cd6 Mon Sep 17 00:00:00 2001 From: Hermes Date: Sat, 8 Aug 2026 18:30:02 +0200 Subject: [PATCH] add Controller enter/back handlers (OK opens movie, Back exits); clear on gone --- plugin.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugin.js b/plugin.js index 23eec3c..8cb4693 100644 --- a/plugin.js +++ b/plugin.js @@ -89,6 +89,24 @@ // fires "hover:enter" on the focused .selector when OK/Enter is pressed. Lampa.Controller.collectionSet(grid); Lampa.Controller.collectionFocus(cards[0], grid); + + // Enter (OK button) and Back handlers for this screen. + Lampa.Controller.add('mymovies', { + enter: function () { + var el = grid.find('.card.selector.focus')[0] || cards[0]; + if (!el) return; + 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 () {