From b7c3927f943477ba9dfb4fea14c2c5148bb314d5 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 24 May 2022 20:52:27 +0300 Subject: [PATCH 1/2] [desktop] keydown event to app when hints is showed --- apps/common/main/lib/controller/Desktop.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 34041768c..25cb45a8c 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -195,6 +195,13 @@ define([ native.execCommand('althints:show', JSON.stringify(visible && !(level > 0))); } + var _onKeyDown = function (e) { + if ( Common.UI.HintManager.isHintVisible() ) { + native.execCommand('althints:keydown', JSON.stringify({code:e.keyCode})); + console.log('hint keydown', e.keyCode); + } + } + return { init: function (opts) { _.extend(config, opts); @@ -287,6 +294,8 @@ define([ }, }, }, {id: 'desktop'}); + + $(document).on('keydown', _onKeyDown.bind(this)); } }, process: function (opts) { From c28efe955a0cb2f5cd622cbf6f939707a92ee2c7 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 25 May 2022 12:32:18 +0300 Subject: [PATCH 2/2] [all] debug for IE --- apps/common/main/lib/controller/Desktop.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 25cb45a8c..21637e975 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -202,6 +202,12 @@ define([ } } + var testObj = { + method: function (p1, p2) { + console.log(`str1 is "${p1}" and str is "${p2}"`); + } + }; + return { init: function (opts) { _.extend(config, opts); @@ -337,7 +343,8 @@ define([ call: function (name) { if ( native[name] ) { let args = [].slice.call(arguments, 1); - return native[name](...args); + // return native[name](...args); + return native[name].apply(this, args); } }, };