🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

qcontextmenu

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qcontextmenu

qcontextmenu is a simple contextmenu menu tool for web

0.0.4
latest
Source
npm
Version published
Weekly downloads
2
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

QContextMenu

  • Support html tags
  • Number of dynamic menus
  • Simple packaging
  • Unlimited levels
  • Browser boundary recognition and adaptation
  • demo

License

BSD 3-Clause License

Installation

 npm i qcontextmenu

Usage

  import ContextMenu from "qcontextmenu";
  let menuTool = new ContextMenu(document.body);
  window.oncontextmenu = function(e) {
            e.preventDefault();
            let x = e.clientX;
            let y = e.clientY;
            menuTool.show(function() {
                return [{
                    target: "edit",
                    text: "<b>edinode</b>wireless level",
                    callback: function(node) {
                        console.log(node);
                    },
                    children: [{
                        target: "edit",
                        text: "edinode2",
                        callback: function(node) {
                            console.log(node);
                        },
                        children: [{
                            target: "edit",
                            text: "edinode3",
                            callback: function(node) {
                                console.log(node);
                            },

                        }, {
                            target: "addChild",
                            text: "addChild",
                            callback: function(node) {
                                console.log(node);
                            },
                        }, {
                            target: "addBrother",
                            text: "addBrother",
                            callback: function(node) {
                                console.log(node);
                            },
                        }, ]
                    }]
                }, {
                    target: "addChild",
                    text: "addChild",
                    callback: function(node) {
                        console.log(node);
                    },
                }, {
                    target: "addBrother",
                    text: "addBrother",
                    callback: function(node) {
                        console.log(node);
                    },
                }, {
                    target: "noThing",
                    text: "noThing",
                    callback: function(node) {
                        console.log("do nothing callback", node);
                    },
                }]

            }, {
                x: x + "px",
                y: y + "px"
            })
        };

Keywords

qcontextmenu

FAQs

Package last updated on 23 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts