add Controller enter/back handlers (OK opens movie, Back exits); clear on gone

This commit is contained in:
Hermes committed 2026-08-08 18:30:02 +02:00
1 parent 66de82496c
commit 7d0c69f995
1 file changed
+18
+18
View File
@@ -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 () {