Issue #648Opened December 15, 2017by effectief0 reactions

Panel may be moveable but prevent move, remove properties on the childs

Question

Hi,

Code SnippetTEXT
How can I prevent move, remove properties on the childs?
In this case (see code below) the user may move the parent (Template_2), but all the childs may not move. 

I tried it with '**propagate**', but these properties are applicable to the parent too. 
I need an option too aply properties specifically on childs.

`blockManager.add('Template_2', {
label: 'Template 2',
content: 'lorem ipsem',
});
const domc = editor.DomComponents;
const defaultType = domc.getType('default');
const defaultModel = defaultType.model;
const defaultView = defaultType.view;

domc.addType('Template_2', {
    model: defaultModel.extend(
	{
		defaults: Object.assign({}, defaultModel.prototype.defaults, 
		{
			// True if the component is removable from the canvas
			removable: true,
			
			// Indicates if it's possible to drag the component inside other
			// Tip: Indicate an array of selectors where it could be dropped inside
			draggable: true,
			
			// Indicates if it's possible to drop other components inside
			// Tip: Indicate an array of selectors which could be dropped inside
			droppable: true,
			
			// Set false if don't want to see the badge (with the name) over the component
			badgable: true,
			
			// True if it's possible to style it
			// Tip:  Indicate an array of CSS properties which is possible to style
			stylable: true,
			
			// Highlightable with 'dotted' style if true
			highlightable: true,
			
			// True if it's possible to clone the component
			copyable: true,
			
			// Indicates if it's possible to resize the component (at the moment implemented only on Image Components)
			resizable: false,
			
			// Allow to edit the content of the component (used on Text components)
			editable: true,
			
			propagate: ['removable','draggable','droppable','editable',]
		}),
	},
	{
		isComponent: function (el)
		{
			
			if (el.tagName == 'DIV')
			{
				return {type: 'Template_2'};
			}
		},
	}),
	view: defaultView,
});`

Answers (2)

artfDecember 19, 20170 reactions

Hi @effectief, create a wrapper for children with that propagate property

parent // movable, removable, etc
    wrapper // with `propogate`, not movable, etc.
        child
        child
        ...
lock[bot]September 18, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.