Allow options for html5
It doesn't seem like you can specify options when using as an html5 polyfill.
Currently I'm testing the following:
case 'html5':
// if <command> or <menuitem> are not handled by the browser,
// or options was a bool true,
// initialize $.contextMenu for them
- if ((!$.support.htmlCommand && !$.support.htmlMenuitem) || (typeof options === 'boolean' && options)) {
+ if ((!$.support.htmlCommand && !$.support.htmlMenuitem) || (typeof options === 'boolean' && options) || (typeof options === 'object' && options.ignoreNative)) {
$('menu[type="context"]').each(function () {
if (this.id) {
- $.contextMenu({
- selector: '[contextmenu=' + this.id + ']',
- items: $.contextMenu.fromMenu(this)
- });
+ var createOptions = $.extend(true, {}, o, {
+ selector: '[contextmenu=' + this.id + ']',
+ items: $.contextMenu.fromMenu(this)
+ } || {});
+ $.contextMenu(createOptions);
}
}).css('display', 'none');
}
break;
The HTML 5 polyfill is exactly a polifill, it should only convert the html menu to a working menu on browser that don't support the menu element. If you want full control, don't use it as a polyfill afaik.
I see where you're coming from, at least for many of the options, however there are some that I believe that it would be fine if we could use them for html5.
Namely I'm currently using it to disable the show/hide animations (well technically just the hide animations because the show is broken), to give a behaviour more similar to the native context menu experience.
I guess there may be a few more options that you might like to use, but animations is the main one for me right now. I suppose you could implement a filter so that only a few carefully selected options are passed through.
@bbrala: Any more I can do to help move this along?