Skip to content

Instantly share code, notes, and snippets.

@jeffgca
Forked from anonymous/gist:4401852
Last active December 10, 2015 07:28
Show Gist options
  • Save jeffgca/4401855 to your computer and use it in GitHub Desktop.
Save jeffgca/4401855 to your computer and use it in GitHub Desktop.
Strawman for improving how context-menu works.
var cm = require('context-menu');
var Item1 = cm.Item({
label: 'Label',
image: data.url('image.png')
});
Item1.on('click', function(context) {
// ...
});
// catch the context menu show event.
Item1.on('show', function(context) {
// return cm.SHOW | cm.DISABLED | cm.HIDE
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment