#2809May 29, 2020by antman33511 answer
Hello, I'm using the modal with some commands. I've noticed when calling modal.setContent( ... ) what ever was in the modal before is moved to a hidden div with class gjs-mdl-collector . Is there a way to destroy the content on close? Or should I just remove the content .innerHTML('') before closing? Thanks, Antonio
artf
If you don't need those references you can clean them manually
#2808May 27, 2020by robertraf3 answers
Hi, I have a question, when I create a custom type component from the editor, what would be the next step to show that component in my application? Currently I am saving the component data in firebase with the firestore plugin, the attributes that are stored in the object are the following: gjs-assets, gjs-components,...
Ju99ernaut
onRender simply specifies what should happen when you successfully place a component onto the canvas, whereas script is code that will be generated in your html inside script tags. Something like:
Ju99ernaut
I think in a production environment all you need is the html and css code generated by grapesjs.
robertraf
I understand that part, but if I want to render the component I have created it doesn't work. I'll explain a little, I have created a type of component that renders data from an endpoint, if I use the html and css code it doesn't work. Cus...
#2807May 27, 2020by alesub3 answers
Hi, I'm currently trying to start the editor "fromElement", setting the following html inside the container: But when executed, grapesjs creates components inside the <p> tag even after setting the data-gjs-type attribute as text. What I'm trying to do is to present the paragraph to be edited as a single component. Yo...
alesub
@artf just to clarify: this bug is based on the expected behaviour you described on this comment: https://github.com/artf/grapesjs/issues/576#issuecomment-348550694 And how the divs with text behave on the demo page. Please let me know if...
alesub
Hi, any luck reviewing this issue? What got me lost is this doesn't happen on the demo page, any bold or italic text doesn't become a separate component after saving or reloading. Any insight will be greatly appreciated, Thanks!
artf
Closing this one as now this is the default behavior. There is also a possibility to customize the behavior via disableTextInnerChilds option added from https://github.com/GrapesJS/grapesjs/releases/tag/v0.21.2
#2805May 27, 2020by EgorPashko3 answers
Hey guys I have some problem related to alert which displayed when I tried log out of page. Actually I do not know bug is it or something else. I have read documentation, but did not get answer yet. If you help me I will gratefully to you. Alert message is "Changes you made may not be saved."
Ju99ernaut
I guess the alert still shows up even if you have storage set up. Add this to your initialization: By default it's set to true
Ju99ernaut
It's probably because you have no storage set up
pjdevries
I thought about storage as well and was about to set up a dummy storage, hoping it would circumvent the problem. The noticeOnUnload: 0 works like a charm though, so no need for that. Thank you very much.
#2803May 26, 2020by motazad1 answer
@artf I want to use the mode translate and absolute But there are some problems 1- Dropping is no longer possibleWhen I set the boxes on the devices (mobile and tablet), if the screen is a little bigger or smaller than the size of the device, there may be a problem with the output.
artf
Using the absolute mode, by design, is harder to deal with responsive pages
#2802May 26, 2020by meyerco1 answer
DescriptionThe bug is reproduced on the current demo What happens ? When switching selection quickly between controls , the editor get stucked . Steps to reproduce on the demo Select one controls and move quickly selection to another . Do this few times the editor will get stucked . The error on console
artf
Thanks for the report @meyerco probably found the main issue, should be fixed in the next release
#2801May 25, 2020by fedd3 answers
I am researching how to make a template with server side expressions that will repeat a component (foreach) or completely remove it (if). My backend parses templates with mvel. What I am thinking is to add a couple of settings to all or some select elements. For example, to a <div> of a Cell, so it looks like this: <d...
Ju99ernaut
To surround an element take look at toHtml, you can search it in the issues for examples. In any case I don't think it's a good idea to replace the default component type, I'd suggest creating a new component that extends the default type...
fedd
The docs for components might be helpful I've written my code based on this article. It says,Updating component types is quite easy, let's see how: .... // The defaults property is handled differently // and will be merged with the old def...
artf
@fedd you can add your new traits in model.init function
#2800May 25, 2020by meyerco3 answers
DescriptionThe bug is reproduced on the current demo Expected behavior When a tooltip is removed its css is removed What happens instead ? When a tooltip is removed its css is not removed Steps to reproduce on the demo Clear the canvas Drag a tooltip Remove the tooltipClick on Import button on top toolbar , the toolti...
artf
Yeah, I think you're right, probably replacing with might fix the issue, would you like to check and create a PR? :)
meyerco
@artf Maybe this code to keep the code generic ?
artf
@meyerco 😅 yeah sure, sorry, it was a copy-paste from my try
#2799May 24, 2020by dintifla3 answers
I am currently working on a web application for which we integrate this project as GUI editor to customize the environments. Our GUI components are loaded and parsed from the database. We can identify e.g. a button, data grid, etc. by an ID (e.g. 17190fbd-13d6-430f-bb32-1a09d2151a77). These components are then built f...
dintifla
a short update: I managed to get the the selectors in the right order when using selectors.unshift(idSelector) instead of selectors.add(idSelector) in above sample. Now i still have the issue with the missing space between the id- and the...
artf
Hi @dintifla SelectorManager is not meant to work like that (you can only have a mix of classes .class1.class2 but not with IDs), but honestly I don't understand what is your goal of using the SelectorManager at all. If you need to query a...
dintifla
Hi @artf Thanks for your reply. In the end it is not just about querying a component, but generate the CSS for it. I don't need the HTML since my application is designed in a rich client application, stored in an abstract representation in...
#2798May 24, 2020by niklasdahlback1 answer
I wonder if it is possible to get the parent and/or index during block:drag event for the resulting component, similar to the parent attribute in the component:drag event? It seems like the event argument passed does not contain any reference to parent. The reason I am asking is that I am working on a solution to prev...
artf
block:drag can't contain the reference to the component as it's not yet created before being dropped