jQuery-contextMenu icon indicating copy to clipboard operation
jQuery-contextMenu copied to clipboard

html5 & callback is not actually working

Open t4r7s opened this issue 7 years ago • 1 comments

The callback in code below is not actually working. What to do in case of html5 menu?

$.contextMenu({
	selector: '.context-menu-one', 
	callback: function(key, options) {
        var m = "global: " + key;
		console.log("callback");
        window.console && console.log(m) || alert(m);
    },
	items: $.contextMenu.fromMenu($('#html5menu'))
});

HTML:

<p><span class="context-menu-one">right click me</span></p>


<menu id="html5menu" type="context" style="display:none">
	<command label="rotate" onclick="alert('rotate')" icon="images/cut.png">
	<command label="resize" onclick="alert('resize')" icon="images/door.png">
	<menu label="share">
		<command label="twitter" onclick="alert('twitter')" icon="images/page_white_copy.png">
		<hr>
		<command label="facebook" onclick="alert('facebook')" icon="images/page_white_edit.png">
		<hr>
		<label>foo bar<input type="text" name="foo"></label>
	</menu>
</menu>

t4r7s avatar Aug 30 '17 11:08 t4r7s

I'm sorry but currently there is no support for a custom callback when building the menu from a HTML5 menu element.

bbrala avatar Aug 30 '17 12:08 bbrala