New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

js-context-menu

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-context-menu

Library for displaying a customizable context menu on right-click mouse button

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Build Status

ContextMenuJS

Library for displaying a customizable context menu on right-click mouse button

REQUIREMENTS

  • FontAwesome (Included by bower)
  • Node
  • NPM

USAGE

Declare icons and labels for contextual menu options

var mlist = {
	"arrow-circle-left": "Atrás",
	"undo": "Deshacer",
	"refresh": "Recargar",
	"question-circle": "Ayuda",
	"close": "Cerrar"
};

Note that "mlist" is a dictionary which Key is the name of the icon (font-awesome library) and Value is the label of the option.

You need to declare also the context menu actions for each button like this:

var mlinks = Array(
	"alert('Seleccionada la opción atrás')",
	"alert('Seleccionada la opción Deshacer')",
	"alert('Seleccionada la opción Recargar')",
	"alert('Seleccionada la opción Ayuda')",
	"alert('Seleccionada la opción Cerrar')"
);

Finally only need to instantiate the ContextMenu object like:

var cm = new ContextualMenu(mlist, mlinks);

TESTING

You can run test suite by running: karma start karma.conf.js

FAQs

Package last updated on 15 Aug 2016

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