remove duplicate keydown back listeners (caused recursion); rely on Lampa native back
This commit is contained in:
1 parent
202fb021b2
commit
d4a5051914
1 file changed
-17
@@ -83,17 +83,9 @@
|
||||
|
||||
this.create = function (b) {
|
||||
body = b;
|
||||
comp._onKey = function (e) {
|
||||
if (e.key === 'Backspace' || e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
Lampa.Activity.back();
|
||||
}
|
||||
};
|
||||
document.addEventListener('keydown', comp._onKey, true);
|
||||
};
|
||||
|
||||
this.destroy = function () {
|
||||
if (comp._onKey) document.removeEventListener('keydown', comp._onKey, true);
|
||||
};
|
||||
|
||||
// Wire up keyboard/remote navigation (pattern from Shikimori plugin).
|
||||
@@ -216,18 +208,9 @@
|
||||
|
||||
this.create = function (b) {
|
||||
body = b;
|
||||
// Browser/keyboard fallback: Backspace / Escape -> back (remote uses Controller 'back')
|
||||
comp._onKey = function (e) {
|
||||
if (e.key === 'Backspace' || e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
Lampa.Activity.back();
|
||||
}
|
||||
};
|
||||
document.addEventListener('keydown', comp._onKey, true);
|
||||
};
|
||||
|
||||
this.destroy = function () {
|
||||
if (comp._onKey) document.removeEventListener('keydown', comp._onKey, true);
|
||||
};
|
||||
|
||||
this.start = function () {
|
||||
|
||||
Reference in new issue
Block a user