From 1663f8a36741f1211a6bb1b39539c2ad815ace81 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Fri, 30 Sep 2022 10:15:22 +0300 Subject: [PATCH] [desktop] send js mouse events to native app --- apps/common/main/lib/controller/Desktop.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 2bb9531f01..046dda2074 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -263,6 +263,21 @@ define([ header.btnHome.on('click', event => { native.execCommand('title:button', JSON.stringify({click: "home"})); }); + + $('#id-box-doc-name').on({ + 'dblclick': e => { + native.execCommand('title:dblclick', JSON.stringify({x: e.originalEvent.screenX, y: e.originalEvent.screenY})) + }, + 'mousedown': e => { + native.execCommand('title:mousedown', JSON.stringify({x: e.originalEvent.screenX, y: e.originalEvent.screenY})) + }, + 'mousemove': e => { + native.execCommand('title:mousemove', JSON.stringify({x: e.originalEvent.screenX, y: e.originalEvent.screenY})) + }, + 'mouseup': e => { + native.execCommand('title:mouseup', JSON.stringify({x: e.originalEvent.screenX, y: e.originalEvent.screenY})) + } + }); } if (!!header.btnSave) {