├── LICENSE
├── README.md
├── demo
└── demo.html
├── package.json
└── src
├── jquery.nu-context-menu.js
└── nu-context-menu.css
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Alex Suyun
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nuContextMenu
2 | A modern context menu with font awesome support for web apps.
3 | The script is extremely light weight (2.2 kB), and it treats the menu as the primary object.
4 | This means that a single menu can be attached to multiple elements.
5 |
6 | # Installation
7 | ``` npm i jquery-nucontextmenu ```
8 |
9 | # Code Example
10 | ``` javascript
11 | $(function() {
12 | var context = $('#node')
13 | .nuContextMenu({
14 |
15 | hideAfterClick: true,
16 |
17 | items: '.demo-item',
18 |
19 | callback: function(key, element) {
20 | alert('Clicked ' + key + ' on ' + $(element)
21 | .attr('id'));
22 | },
23 |
24 | menu: [
25 |
26 | {
27 | name: 'archive',
28 | title: 'Archive',
29 | icon: 'archive',
30 | },
31 |
32 | {
33 | name: 'mark',
34 | title: 'Mark as read',
35 | icon: 'check',
36 | },
37 |
38 | {
39 | name: 'void'
40 | },
41 |
42 | {
43 | name: 'delete',
44 | title: 'Delete',
45 | icon: 'trash',
46 | },
47 | ]
48 |
49 | });
50 |
51 | $('#node')
52 | .append('
Item 5
');
53 |
54 | // Disable context menu
55 | // context.nuContextMenu('disable');
56 |
57 | // Remove context menu
58 | // context.nuContextMenu('destroy');
59 |
60 | });
61 | ```
62 | # Screenshots
63 | ![Screenshot] (https://cloud.githubusercontent.com/assets/13611918/10264217/117b0946-69d3-11e5-8914-e00c391065e1.png)
64 |
65 | # License
66 | The MIT License (MIT)
67 |
68 | Copyright (c) 2015 Alex Suyun
69 |
70 | Permission is hereby granted, free of charge, to any person obtaining a copy
71 | of this software and associated documentation files (the "Software"), to deal
72 | in the Software without restriction, including without limitation the rights
73 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
74 | copies of the Software, and to permit persons to whom the Software is
75 | furnished to do so, subject to the following conditions:
76 |
77 | The above copyright notice and this permission notice shall be included in all
78 | copies or substantial portions of the Software.
79 |
80 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
86 | SOFTWARE.
87 |
--------------------------------------------------------------------------------
/demo/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | nuContextMenu Demo Page
9 |
10 |
11 |
81 |
82 |
83 |
84 |