# eeeasy-context-menu

> context menu javascript library

Latest version **0.0.16** (published 2020-08-24) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install eeeasy-context-menu
pnpm add eeeasy-context-menu
yarn add eeeasy-context-menu
bun add eeeasy-context-menu
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.16 |
| Published | 2020-08-24 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | bino0216 |
| Maintainers | bino0216 |
| Keywords | context |

## Links

- npm: https://www.npmjs.com/package/eeeasy-context-menu
- Repository: https://github.com/bino0216/context-menu
- Issues: https://github.com/bino0216/context-menu/issues
- npm.io page: https://npm.io/package/eeeasy-context-menu

## Recent versions

- 0.0.16 (latest) — 2020-08-24
- 0.0.15 — 2020-08-24
- 0.0.14 — 2020-08-24
- 0.0.13 — 2020-08-24
- 0.0.12 — 2020-08-24
- 0.0.11 — 2020-08-24
- 0.0.1 — 2020-08-24

## README

# Context Menu Library
context menu made as easy to use as possible.

# How to use

```javascript
// Just declare
const contextMenu = new ContextMenu();
```
if you want to use, just use to easy.

when you declare new contextMenu object, context menu created body tag's last one.
and all preparations are completed.

# prepare
first, attach style sheet.
```javascript
require('eeeasy-context-menu/contextMenu.css');
```


but context-menu does not appear everywhere.
only a few conditions are needed.

1. decide a condition's kind.
```javascript
import ContextMenu from 'eeeasy-context-menu'

const contextMenu = new ContextMenu({
    allowClassName: 'context-access' // it is default status.
});
```
2. if class is cumbersome, use attribute.
```javascript
// In this case, the above method is ignored.
const contextMenu = new ContextMenu({
    allowAttributeName: 'data-context-access'
});
```

# add management list
Finally, should to add option.

```html
<div class="square context-access"></div>
<!-- or -->
<div class="square" data-context-access></div>
```

```javascript
const contextMenu = new ContextMenu();
contextMenu.addOptions('square', [
    // optionName, callBack
    ['alert', () => {
        alert('!');
    }],
    ['remove', () => {
        document.querySelector('.square').outerHTML = 'die';
    }]
]);
```

---
_Source: https://npm.io/package/eeeasy-context-menu · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
