4.0.1 • Published 5 years ago

@abcum/ember-contextmenu v4.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

ember-contextmenu

An ember addon for adding contextual shortcut menus to an Ember.js app.

npm.io npm.io npm.io npm.io npm.io npm.io

Usage

Installation

ember install @abcum/ember-contextmenu

Introduction

The ember-contextmenu addon adds functionality for adding contextual shortcut menus to an Ember.js app, using the right click button. A custom context menu can be applied to the whole application, in addition to individual menus for a specific area, or an ember component.

Examples

Add the context-menu component to your application template.

{{!-- app/templates/application.hbs --}}
{{context-menu}}

To prevent the default menu from appearing, add the right-click component to the application template.

{{!-- app/templates/application.hbs --}}
{{#right-click menu="application.menu"}}
	{{!-- all content --}}
{{/right-click}}
{{!-- app/templates/application/menu.hbs --}}
<div class="context-menu-item" {{action (history-back)}}>Back</div>
<div class="context-menu-item" {{action (history-forward)}}>Forward</div>
<div class="context-menu-item" {{action (reload)}}>Reload</div>
<div class="context-menu-item" {{action (transition-to 'logout')}}>Logout</div>
<div class="context-menu-line"></div>
<div class="context-menu-item disabled">© Abcum Ltd</div>

When adding a menu to a component use the context-menu mixin, and specify a file using the menuName key.

import Ember from "ember";
import MenuMixin from 'ember-contextmenu/mixins/context-menu';

export default Ember.Component.extend(MenuMixin, {
	menuName: 'posts.menu',
});

Or if you want to display a menu after an action, use the context-menu helper, specifying a filename.

{{#each model as |post|}}
	{{blog-post contextMenu=(context-menu 'post.menu' model=post)}}
{{/each}}

Development

  • make install (install bower and ember-cli dependencies)
  • make upgrade (upgrade ember-cli to the specified version)
  • make tests (run all tests defined in the package)
4.0.1

5 years ago

4.0.0

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

7 years ago