Hi, editor.on('run:preview', () => { console.log('preview ON') }) This is working fine. Now I need the command event that is triggered when we click "Hide Preview".
artf
stop:preview
theanhmx
editor.on('run:preview', () => { console.log('preview ON') }) editor.on('stop:preview', () => { console.log('preview OFF') }) i tried this but the stop:preview event didn't fire
artf
Fixed by https://github.com/artf/grapesjs/pull/592
Hi, Is it possible to hide "BannerOptionsBtn" component when I click preview button. I Used toHTML() function. And when I called editor.getHtml() it is returning the html as expected, but when I click preview button the "BannerOptionsBtn" appears. Here is the code. Please Help me domc.addType('bannergal', { model: def...
artf
You can make use of command events inside your component, eg.
sanjeevSavitr
Thanks for the help. And please send the command event that is triggered when we click "Hide Preview".
lock[bot]
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.
Hi! I would like to add a CSS rule that, for instance, changes appearance of a component based on some attribute. I.e. Is there a way of doing that programmatically? Or any other way for that matter. Thanks, Misha
artf
try with this
lock[bot]
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.
I want to add new property as Line height in Typography in Style manager. Can you please help me out? Also, how to apply css formatting to particular element by selecting this newly added property.
artf
You can get it from the demo https://github.com/artf/grapesjs/blob/gh-pages/demo.html#L1054
lock[bot]
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.
Hi @artf, As you must know, at my company we are creating a product based on GrapesJS. We are trying to keep as close as possible from GrapesJS core. As developers we are trying our best to not create a fork from GrapesJS and keep contributing back to the repo. Now, we have a new feature to create and we would like to...
arthuralmeidap
You are the man!!! Thanks a lot!! I will try it !!!!
artf
Thanks Arthur, really appreciate your help. Seems like you're doing an awesome work, I think this feature could be a perfect candidate for a plugin :)
arthuralmeidap
I need to make some changes into some Models/Views inside GrapesJS. How can I achieve with plugins? Any ideas?
hi @artf , is it possible to replace current asset manager , from my custom one? I have created my own asset manager , i want to use that to upload images and all. is it possible?
artf
no @suraj740 target is the component model, you should add your custom open-assets command
suraj740
Thanks @artf , i was able to replace current asset manager to custom one. Thanks for giving that commands.
Hi, From time to time, on my canvas the highlighter and toolbar appear in the wrong place. Is this a known bug? Do I have to manually refresh the canvas? It seems that the top css property on gjs-highlighter and gjs-badge aren't being calculated properly, they still line up horizontally just not vertically. Any ideas?...
artf
I'm aware of the toolbar "jump" when the content inside it changes (by adding or removing buttons) but not with the highlighter. Do you use the editor inside a scrolled page?
telliott22
Any way to stop the jumping when the content changes? Yes, the page is scrolled. Should I limit the height of the editor to the browsers height?
artf
Yeah, unfortunately, there is a bug which doesn't get a correct dimension of the scrolled page
I've created a custom type, and a block is it possible to insert it into DomComponents by name or any other means? I don't want to be drag'n'dropping the block manually each time. Thanks.
z-vr
Oh I found out how to do it -- via editor.addComponents({ type: 'MyComponent' }). Is there a way to insert it into a specific element by a CSS selector? Found this snippet, but how would i find the correct index?
z-vr
ok so what i've done is and then I think traversing the model tree would be a very good feature -- I'll work on the PR at some point. Cheers!
artf
You can actually get the model from the cash element instance with view.$el.data('model'), so you might make it work with less code
Hi @artf , very great web builder framework and keep it up :+1: code : As you can see, can i make tag dynamically from my backend? i use EJS template for my view render engine and can passing data to ejs. Thank you very much and have a nice day
artf
You can update the block's content in this way
bungambohlah
Oh i see , thank a lot @artf
bungambohlah
Hi, @artf I have a problem, my dynamic-nav's block works now, but when I give some script to that component its give me an error . May I correct? if not please correct me, thank you very much That's my script :
Hi, We are evaluating GrapesJS for one of requirement. As part of the evaluation i am creating custom command 'insert placeholder', what it does is ( what i am planning to do ) is when a select Text and when i click this command , it should insert text at the selected cursor position. Initially i had done this var exi...
mathieuk
Duplicate with #481
sarathksasi
Thanks
edwardjiawei
Similar to what I did in grapesjs-plugin-customrte. But I no propose my code to be based on, at it is mess. You should able to test the code in design,html in my repo. Also can set lower priority for implement el.contentEditable, so that t...