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

htmlelement-contextmenu

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

htmlelement-contextmenu

make a contextmenu on a html element

0.8.0
Source
npm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

htmlelement-contextmenu

build version package dependencies minified linter tests license hits

The lastest version of this document is available on Github > htmlelement-contextmenu

Installation

npm install htmlelement-contextmenu --save

or

yarn add htmlelement-contextmenu --save

prerequisites

for browser

<script src="node_modules/htmlelement-contextmenu/distrib/htmlelement-contextmenu.min.js"></script>

usage

 <link rel="stylesheet" href="htmlelement-contextmenu.min.css" />
<script src="htmlelement-contextmenu.min.js"></script>

 <div id="div1">right click here</div>
<script>
var menu = {
  menuId: "menu1",
  targetId: "#div1",
  items: [{
    key: "cut",
    label: "cut",
    fn: () => console.log("cut")
  }, {
    label: "sep"
  }, {
    key: "copy",
    label: "Copy",
    fn: () => console.log("copy")
  }, {
    key: "paste",
    label: "Paste",
    showing: () => {
      let val = document.querySelector("#t1");
      return (val.value < 5) ? "cmDisabled" : "-cmDisabled";
    },
    fn: () => console.log("paste")
  }]
};

CM(menu);
</script>

Keywords

html5

FAQs

Package last updated on 08 May 2018

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