UNPKG

gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

45 lines (41 loc) 2.1 kB
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>LightBox Style HTML Custom Context Menu</title> <meta name="description" content="Demonstrate context menus implemented in HTML covering the whole window." /> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Copyright 1998-2020 by Northwoods Software Corporation. --> <link rel='stylesheet' href='../extensions/LightBoxContextMenu.css' /> <script src="../samples/assets/require.js"></script> <script src="../assets/js/goSamples.js"></script> <!-- requires minimal.js, built from minimal.ts --> <script> function init() { require(["htmlLightBoxContextMenuScript", "../extensionsTS/LightBoxContextMenu"], function(app) { app.init(); }); } </script> </head> <body onload="init()"> <div id="sample"> <div style="display: inline-block;"> <div style="position: relative"> <div id="myDiagramDiv" style="border: solid 1px black; width:400px; height:400px"></div> </div> <div id="description"> <p> This demonstrates the implementation of a custom HTML context menu using <a>HTMLInfo</a>. This sample is also a re-implementation of the built-in <a>ContextMenuTool.defaultTouchContextMenu</a>. </p> <p>The implementation is contained in the files <a href="../extensionsTS/LightBoxContextMenu.ts">LightBoxContextMenu.ts</a> and <a href="../extensionsTS/LightBoxContextMenu.css">LightBoxContextMenu.css</a>. The JavaScript file exposes <code>window.myHTMLLightBox</code>, which is used in this file as the value of <code>myDiagram.contextMenu</code>. <p>For a more regular HTML context menu implementation, see the <a href="customContextMenu.html">Custom Context Menu</a> sample.</p> <p>Right-click or tap-hold (mobile) on a Node to bring up a context menu. If you have a selection copied in the clipboard, you can bring up a context menu anywhere to paste.</p> </div> </div> </div> </body> </html>