Issue #669Opened December 22, 2017by TWCM0 reactions

Any approach to use class to control the data-gjs-{property} ?

Question

Hi @artf, any approach to use class to control the data-gjs-property? Such as i added a class "non-copyable" to element, then the component will auto change the copyable property to false, let the user cannot copy the element in the editor.

Answers (2)

artfDecember 22, 20170 reactions

You can make use of Events

editor.on('component:add', model => {
	const cls = model.getAttributes()['class'];
	cls == 'non-copyable' && model.set('copyable', 0);
})
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.