fix: do not reset focus to card[0] on late apply() retries (stops remote right->left jump)
This commit is contained in:
1 parent
975eb70697
commit
1ad2eb5d16
1 file changed
+6
-1
@@ -98,10 +98,15 @@
|
||||
var cards = g.find('.card.selector');
|
||||
if (!cards.length) return;
|
||||
|
||||
// Re-register controller on every call, but only reset focus the FIRST time
|
||||
// (so an async catalog load / late retry does not yank focus back to card[0]).
|
||||
var first = !apply._inited;
|
||||
apply._inited = true;
|
||||
|
||||
Lampa.Controller.add('content', {
|
||||
toggle: function () {
|
||||
Lampa.Controller.collectionSet(g);
|
||||
Lampa.Controller.collectionFocus(cards[0], g);
|
||||
if (first) Lampa.Controller.collectionFocus(cards[0], g);
|
||||
},
|
||||
right: function () { Navigator.move('right'); },
|
||||
left: function () {
|
||||
|
||||
Reference in new issue
Block a user