Disable right-click context menu

This commit is contained in:
David Rowe 2016-03-31 12:27:08 +13:00
parent 870636832f
commit ba43843340
4 changed files with 21 additions and 1 deletions

View file

@ -267,6 +267,11 @@
window.onresize = resize; window.onresize = resize;
resize(); resize();
}); });
// Disable right-click context menu which is not visible in the HMD and makes it seem like the app has locked
document.addEventListener("contextmenu", function (event) {
event.preventDefault();
}, false);
} }
</script> </script>
</head> </head>

View file

@ -1289,6 +1289,10 @@
elDropdowns = document.getElementsByTagName("select"); elDropdowns = document.getElementsByTagName("select");
} }
// Disable right-click context menu which is not visible in the HMD and makes it seem like the app has locked
document.addEventListener("contextmenu", function (event) {
event.preventDefault();
}, false);
} }
</script> </script>
</head> </head>

View file

@ -119,6 +119,11 @@
EventBridge.emitWebEvent(JSON.stringify({ type: 'init' })); EventBridge.emitWebEvent(JSON.stringify({ type: 'init' }));
}); });
// Disable right-click context menu which is not visible in the HMD and makes it seem like the app has locked
document.addEventListener("contextmenu", function (event) {
event.preventDefault();
}, false);
} }
</script> </script>
</head> </head>

View file

@ -20,6 +20,12 @@
<script type="text/javascript" src="../html/eventBridgeLoader.js"></script> <script type="text/javascript" src="../html/eventBridgeLoader.js"></script>
<script type="text/javascript" src="particleExplorer.js?v42"></script> <script type="text/javascript" src="particleExplorer.js?v42"></script>
<script> <script>
function loaded() {
// Disable right-click context menu which is not visible in the HMD and makes it seem like the app has locked
document.addEventListener("contextmenu", function (event) {
event.preventDefault();
}, false);
}
</script> </script>
<style> <style>
@ -60,7 +66,7 @@ body{
</style> </style>
</head> </head>
<body> <body onload="loaded();">
<div class="importer"> <div class="importer">
<input type='text' id="importer-input" placeholder="Import: Paste JSON here." onkeypress="handleInputKeyPress(event)"> <input type='text' id="importer-input" placeholder="Import: Paste JSON here." onkeypress="handleInputKeyPress(event)">
<div class = "exported-props-section"> <div class = "exported-props-section">