grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Can we set a class to wrapper

Open suchithmahadi opened this issue 8 years ago • 5 comments

Hello ,

As per the document , // Change background of the wrapper and set some attribute var wrapper = domComponents.getWrapper(); wrapper.set('style', {'background-color': 'red'}); wrapper.set('attributes', {'title': 'Hello!'});

Can we set a class to wrapper.

Please let us know how to set a class to the root component i.e. wrapper.

Thanks.

suchithmahadi avatar Jan 05 '18 07:01 suchithmahadi

Sure editor.DomComponents.getWrapper().addClass('wrapper')

artf avatar Jan 05 '18 12:01 artf

@artf , Thanks for the reply.

Can we do editor.DomComponents.getWrapper().addClass('wrapper')

in the release 0.10.7

Thanks.

suchithmahadi avatar Jan 05 '18 13:01 suchithmahadi

Sorry to bother you,

Because when i tried in version 0.10.7 it is giving a error [Error] TypeError: wrapper.addClass is not a function. (In 'wrapper.addClass('wrapper')', 'wrapper.addClass' is undefined) Global Code (index.html:4474) And one more request , i do not want to update to latest release, so can you tellme , any possible way to achieve this.

Thanks.

suchithmahadi avatar Jan 05 '18 13:01 suchithmahadi

I do not want to update to latest release, so can you tellme , any possible way to achieve this

Sorry but GrapesJS is in active development so it doesn't make sense for me supporting older versions

artf avatar Jan 05 '18 13:01 artf

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.

lock[bot] avatar Sep 18 '19 02:09 lock[bot]