diff options
author | Henry Castro <hcastro@collabora.com> | 2020-01-07 14:04:14 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2020-01-08 18:21:14 +0100 |
commit | e9d11f4a6605809d52d4205ec9ff91a6ffef143b (patch) | |
tree | f50b61565f0d87eac180c4965cce4e279ea0e073 /loleaflet/js/global.js | |
parent | 026500b3a5d60e90e2d34c10fb82ffeef0eeb68c (diff) |
loleaflet: simplify "prevent default 'contextmenu' action"
The mobile and desktop prevents default 'contextmenu' action
Change-Id: I89171c955c153b2fceaad92970e2eaf039cb8527
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86373
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'loleaflet/js/global.js')
-rw-r--r-- | loleaflet/js/global.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index b3b619f8c..8445ecb4f 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -1,6 +1,14 @@ /* -*- js-indent-level: 8 -*- */ (function (global) { + document.addEventListener('contextmenu', function(e) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + }, false); + global.fakeWebSocketCounter = 0; global.FakeWebSocket = function () { this.binaryType = 'arraybuffer'; |