yabwe/medium-editor

Dont show anchor preview on a disabled medium editor element?

sazr opened this issue · 0 comments

sazr commented

Is it possible to temporarily disable the anchor preview for a specific element? As an example; I have a p element that can be edited with Medium Editor but it can also be 'disabled'. When disabled, it should not be editable by Medium Editor AND it should not show the anchor preview when the mouse hovers over the element.

I can achieve the first part (disabling editing using the Medium Editor) by adding the attribute contenteditable="false". But I cannot achieve the second part - not showing the anchor preview when the mouse hovers over the HTML element.

Do you know how I can not show the anchor preview for a specific element? The below code CAN detect when the user hovers a 'disabled' element but I don't know how to then disallow/hide the anchor preview box:

	$.mediumEditor.subscribe('editableMouseover', function(ev, ele) {
		if ($(ele).attr('contenteditable') == 'false') {
			// Now how do I disallow the anchor preview from showing?
			// The below code does not stop it

			ev.preventDefault();
			ev.stopPropagation();
			return false;
		}
	});