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

Help stop Propagation

Open jamesecker opened this issue 7 years ago • 3 comments

I have downloaded the current version, and created a test page. In the test page if I use list elements the function propagates from the top list item down to the lower list items. Is there a method to stop this from happening? Thank you for your help?

<html>
	<head>
		<link href="dist/jquery.contextMenu.min.css" rel="stylesheet" type="text/css" />
		
		<script language="javascript" src="https://code.jquery.com/jquery-3.2.1.js"></script>
		<script language="javascript" src="src/jquery.ui.position.js"></script>
		<script language="javascript" src="src/jquery.contextMenu.js"></script>
		<script>
		  $(function() {
				$.contextMenu({
					selector: '.context-menu-one', 
					callback: function(key, options) {
						var m = "clicked: " + key;
						alert(m); 
					},
					items: {
						"edit": {name: "Edit", icon: "edit"},
						"cut": {name: "Cut", icon: "cut"},
					   	"copy": {name: "Copy", icon: "copy"},
						"paste": {name: "Paste", icon: "paste"},
						"delete": {name: "Delete", icon: "delete"},
						"sep1": "---------",
						"quit": {name: "Quit", icon: function(){
							return 'context-menu-icon context-menu-icon-quit';
						}}
					}
				});
			});
		</script>
	</head>
	<body>
		<span class="context-menu-one btn btn-neutral">right click me</span><br>
	
		<span class=" btn btn-neutral">right click me</span><br>
		<ul >
			<li class="Docs context-menu-one" style="list-style-type: none;"> Testing
				<ul >
					<li class="upTest" style="list-style-type: none;">
						<a href="#">dfasfsdafas</a>
					</li>
				</ul>
			</li>
		</ul>
		<span class=" btn btn-neutral">right click me</span><br>
		<span class=" btn btn-neutral">right click me</span><br>
 
	</body>
</html>

jamesecker avatar Jul 01 '17 21:07 jamesecker

I'm really not sure what you are asking specifically. Sorry.

bbrala avatar Aug 30 '17 12:08 bbrala

Sorry this email ended up in my junk mail.

I would like to apply the context menu on only a set of items, but not on others. Currently if I apply the context menu to a class, the children of the object also inherit the context menu. I would like to prevent this from happening.


From: Björn Brala [email protected] Sent: Wednesday, August 30, 2017 5:23:08 AM To: swisnl/jQuery-contextMenu Cc: jamesecker; Author Subject: Re: [swisnl/jQuery-contextMenu] Help stop Propagation (#546)

I'm really not sure what you are asking specifically. Sorry.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/swisnl/jQuery-contextMenu/issues/546#issuecomment-325973948, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATi8SC8SarMGgmhXFsGKz2_ahm8AKYUHks5sdVQsgaJpZM4OLazc.

jamesecker avatar Oct 08 '17 20:10 jamesecker

Hmm, nu first idea would be stopping propagation of events in the children yourself. That might stop the context menu from triggering.

Op 8 okt. 2017 22:15 schreef "jamesecker" [email protected]:

Sorry this email ended up in my junk mail.

I would like to apply the context menu on only a set of items, but not on others. Currently if I apply the context menu to a class, the children of the object also inherit the context menu. I would like to prevent this from happening.


From: Björn Brala [email protected] Sent: Wednesday, August 30, 2017 5:23:08 AM To: swisnl/jQuery-contextMenu Cc: jamesecker; Author Subject: Re: [swisnl/jQuery-contextMenu] Help stop Propagation (#546)

I'm really not sure what you are asking specifically. Sorry.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub<https://github.com/ swisnl/jQuery-contextMenu/issues/546#issuecomment-325973948>, or mute the thread<https://github.com/notifications/unsubscribe- auth/ATi8SC8SarMGgmhXFsGKz2_ahm8AKYUHks5sdVQsgaJpZM4OLazc>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/swisnl/jQuery-contextMenu/issues/546#issuecomment-335034834, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJG-qHvsIk5U3INgOnnpcmfmO89uW1oks5sqS12gaJpZM4OLazc .

bbrala avatar Oct 09 '17 07:10 bbrala