web: Configuration to disable context menu on touch
This commit is contained in:
parent
1908d85f65
commit
68f493336a
|
@ -22,6 +22,7 @@ export const DEFAULT_CONFIG: Required<BaseLoadOptions> = {
|
|||
logLevel: LogLevel.Error,
|
||||
showSwfDownload: false,
|
||||
contextMenu: true,
|
||||
touchContextMenu: true,
|
||||
// Backwards-compatibility option
|
||||
preloader: true,
|
||||
splashScreen: true,
|
||||
|
|
|
@ -338,6 +338,14 @@ export interface BaseLoadOptions {
|
|||
*/
|
||||
contextMenu?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not to show a context menu when long-pressing
|
||||
* a Ruffle instance on touch devices.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
touchContextMenu?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not to show a splash screen before the SWF has loaded with Ruffle (backwards-compatibility).
|
||||
*
|
||||
|
|
|
@ -1335,6 +1335,9 @@ export class RufflePlayer extends HTMLElement {
|
|||
|
||||
if (
|
||||
(this.loadedConfig && this.loadedConfig.contextMenu === false) ||
|
||||
(this.isTouch &&
|
||||
this.loadedConfig &&
|
||||
this.loadedConfig.touchContextMenu === false) ||
|
||||
this.contextMenuForceDisabled
|
||||
) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue