All Projects → Wildhoney → Ngcontextmenu

Wildhoney / Ngcontextmenu

Licence: mit
Handcraft your very own context menus for a richer UX!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ngcontextmenu

JonContextMenu
A beautiful and minimalist arc menu like the Pinterest one, written in Swift
Stars: ✭ 60 (-25.93%)
Mutual labels:  menu, contextmenu, context-menu
Context Menu.ios
You can easily add awesome animated context menu to your app.
Stars: ✭ 1,854 (+2188.89%)
Mutual labels:  menu, contextmenu, context-menu
ContextMenuSwift
A better version of iOS 13 Context Menu
Stars: ✭ 162 (+100%)
Mutual labels:  menu, contextmenu, context-menu
vue3-context-menu
A very simple context menu component for Vue3 一个简洁美观简单的Vue3右键菜单组件
Stars: ✭ 74 (-8.64%)
Mutual labels:  menu, contextmenu, context-menu
React Menu
React component for building accessible menu, dropdown, submenu, context menu and more.
Stars: ✭ 237 (+192.59%)
Mutual labels:  menu, contextmenu
Vue Menu
Menu/Contextmenu Component for vue2
Stars: ✭ 227 (+180.25%)
Mutual labels:  menu, contextmenu
ShellAnything
ShellAnything is a C++ open-source software which allow one to easily customize and add new options to *Windows Explorer* context menu. Define specific actions when a user right-click on a file or a directory.
Stars: ✭ 103 (+27.16%)
Mutual labels:  contextmenu, context-menu
ctxmenu
Tiny and customizable context menu generator
Stars: ✭ 20 (-75.31%)
Mutual labels:  contextmenu, context-menu
ng2-right-click-menu
Right click context menu for Angular 2+
Stars: ✭ 51 (-37.04%)
Mutual labels:  contextmenu, context-menu
ember-right-click-menu
An easy and flexible addon to add context menus anywhere in your application
Stars: ✭ 14 (-82.72%)
Mutual labels:  menu, context-menu
xMenuTools
Extended context menu tools for Windows
Stars: ✭ 56 (-30.86%)
Mutual labels:  menu, context-menu
Jquery Ui Contextmenu
jQuery plugin that turns a jQueryUI menu widget into a context menu.
Stars: ✭ 170 (+109.88%)
Mutual labels:  menu, context-menu
V Selectmenu
SelectMenu for Vuejs, A simple, easier and highly customized menu solution
Stars: ✭ 169 (+108.64%)
Mutual labels:  menu, contextmenu
VirusTotalScanner
Scan suspicious applications with over 60 different anti-viruses with a mere two clicks and five seconds!
Stars: ✭ 18 (-77.78%)
Mutual labels:  contextmenu, context-menu
Open in Windows Terminal
No description or website provided.
Stars: ✭ 24 (-70.37%)
Mutual labels:  contextmenu, context-menu
elm-contextmenu
Flexible context menu for Elm
Stars: ✭ 16 (-80.25%)
Mutual labels:  contextmenu, context-menu
rctx-contextmenu
✨ Context menu for React
Stars: ✭ 23 (-71.6%)
Mutual labels:  contextmenu, context-menu
React Contexify
Add a context menu to your react app with ease
Stars: ✭ 575 (+609.88%)
Mutual labels:  menu, context-menu
Msys2 Mingw Shortcut Menus
Configuration files needed to set up right-click shortcut in context menus for MSYS2, MinGW32/64 bash
Stars: ✭ 60 (-25.93%)
Mutual labels:  context-menu
Eeh Navigation
An AngularJS menu module.
Stars: ✭ 74 (-8.64%)
Mutual labels:  menu

ngContextMenu

Travis   npm   License MIT

Getting Started

Using ngContextMenu you can easily support custom context menus for your application! Custom context menus are somewhat underused, but applications such as Gmail use them wisely to provide a richer UX.

First and foremost, you must add the script in your index.html and add the dependency to your module:

var app = $angular.module('menuApp', ['ngContextMenu']);

Then, you must create your context menu, which should be placed into your application as a separate file – a partial.

<ul class="menu">
    <li>Read Message</li>
    <li>Reply to {{from}}</li>
    <li>Delete Message</li>
</ul>

Once you have the partial configured you can hook up the ngContextMenu directive using the data-context-menu attribute – passing along the path to your previously crafted partial. You may also supply an optional ngModel which will be used to evaluate the template – otherwise it will be evaluated against an empty object ({}).

<li data-context-menu="context-menus/message.html" ng-model="message"></li>

Before you begin to test the context menu, you must ensure that your context menu is positioned absolutely, since ngContextMenu will apply the top and left properties to the node which will ensure it's opened where the cursor invoked the opening of the menu.

ul.menu {
    position: absolute;
}

Now when you test your newly setup context menu, a right click on the node with the data-context-menu attribute will open the context menu. Voila!

Service

ngContextMenu ships with a simple contextMenu service which creates the necessary relationship between all of the context menus – this allows the opening of another menu —or a click on the document node— to close the currently opened menu.

Sometimes you may wish to invoke this behaviour yourself, in which case you need to add the contextMenu service to your controller, directive, service, and then invoke the cancelAll method on it.

Item Controllers

In some circumstances you may wish to add a controller for each context menu, in these cases it is preferrable to add the ng-controller attribute to the element that also has the data-context-menu attribute:

<li class="message" ng-controller="MessageController as mc" data-context-menu="context-menus/message.html">
    /* ... */
</li>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].