GrapesJS Issues

Search parsed GitHub issues, see highlighted answers, and open the original discussion when needed.

3464 issues found

#841February 6, 2018by kewilson3 answers
3 reactions

[QUESTION] Add default Trait (attribute) to model for all HTML Components (elements)

Hi, I've read the Traits, Components and API wikis, grepped all the open & closed issues. I've even found the code where you are creating the defaults (ID, Title, Alt) you have today. There have been similar questions asked but none answer the question at hand. For every HTML component I want to add another default at...

ryandeba

Hi @kewilson, You've got a few different approaches for how to accomplish this...if every single component needs this custom trait, then I would probably override the initialize method of the default component type and add it there. Someth...

kewilson

Hey @ryandeba thanks so much for the suggestions. I put in the second one and it works for, well, the defaults as you would expect. Blocks like link, image, input just to name a few it doesn't add the attribute but those must be classified...

josefph

@kewilson could you help me adding another default trait in a specific component?

#840February 5, 2018by austinbiggs3 answers
0 reactions

[Bug]: When dragging an element, misleading drop placeholder

GrapeJs Version: 13.8 Local Copy JSFiddle: https://jsfiddle.net/austinbiggs/tgsykuq4/ This bug is a bit hard to explain, but should be pretty straight forward in recreating. I have menu links that are restricted to being draggable within the parent <nav>, however when dragging, a false drop placeholder appears at the...

artf

@AustinTBiggs I don't know if it's just this, but your links have data-gjs-draggable=".menu nav.menu" which instead should be something like data-gjs-draggable="nav.menu"

austinbiggs

@artf While I'm confused why that change is necessary (it's a valid selector), I made the change. Unfortunately, I'm still seeing the issue. I've updated my Fiddle to show this

artf

With .menu nav.menu you mean that you can drag only inside nested menus, maybe it supposed to be .menu, nav.menu? Here is my version and it works as expected https://jsfiddle.net/wsn33167/

#839February 5, 2018by JulyanoF3 answers
1 reactions

[QUESTION] Create custom selected component settings

There is a option in panel to change setting of component (For links, there is an option no change link - HREF - and target, for texts, id and title and for images, alt attribute). I would like to know how can I create that inputs and how can I change this attrs in selected component? I created a Panel's view to use a...

arthuralmeidap

@JulyanoF , Sorry, I missed the parenthesis. It is editor.TraitManager.getTraitsViewer().el

arthuralmeidap

Here is what you looking for: https://github.com/artf/grapesjs/wiki/Components

JulyanoF

@arthuralmeidap ok, but how can I show the component in my current Command?

#838February 5, 2018by josefph3 answers
4 reactions

[QUESTION] How do I save the images to database?

Please do bare with me but it's really hard to understand the documentation. Can you guys help me do do this?

JulyanoF

@pranzikkin @pranzikkin it is an array of files:$FILES['files']You can debug and see the response on browser's network (console).As it is passing a single file of each time, the file is passing at the first position, so you can take the na...

arthuralmeidap

@pranzikkin put the http\https for the url; something like http://<youraddress>

josefph

@JulyanoF thank you for the great help. got it working now. @arthuralmeidap thank you for the help. got it working now.

#837February 5, 2018by RiyaThete3 answers
0 reactions

[QUESTION] Javascript Deletes

Whenever I import, using import plugin, javascript part of the code is deleted. Is there any way to preserve it? I want to used the exported html file directly, but cannot use it now because javascript is missing in it

arthuralmeidap

What is the name of the plugin?

RiyaThete

The 3rd last import plugin .It is available on http://grapesjs.com/demo.html

arthuralmeidap

try to run editor.getJs(). see if it returns the previous imported JS.

#836February 5, 2018by kickbk2 answers
1 reactions

intercept and prevent an asset from being removed

How would you go about intercepting and preventing an asset from being removed? I suspect the image may already have been removed by the time we run "asset:remove". If so how do we tap into the actions and ask for confirmation? The reason I ask is because I want to tie a deletion in GJS to permanent deletion of images...

kickbk

Missed it in the docs.

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.

#835February 4, 2018by chiqui3d2 answers
1 reactions

Update the Canvas with a custom function

I'm trying to create a function that replaces all the attributes of link, these make the change in the canvas, but don't save it when I try it with the editor.storage() function; here the code:

artf

@chiqui3d in this way you're just updating the view, the output code is generated by the model instead (when you update the model changes are reflected in the view) So your example will be something like 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.

#834February 4, 2018by Praunda3 answers
2 reactions

[Question] Is there anyway to edit the final HTML - CSS code with an integrated code editor?

Hello there! I was wondering if I can edit the final code with a code editor.

cjpollard

Someone put up a nice bit of code for that here. https://github.com/artf/grapesjs/issues/74#issuecomment-322427387

JulyanoF

@Praunda to get html to edit: editor.getHtml(); to get css to edit: editor.getCss();

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.

#833February 4, 2018by rohanreddyg2 answers
0 reactions

[Bug]: on click of links with events Editor loading inside another editor

I am trying to load an existing Ad content into GrapesJS editor. On dragging new custom components into editor with some script, editor is loading inside the root editor frame. Not sure what is causing this issue.

artf

@rohanreddyg can you create a live demo of your case, please

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.

#832February 2, 2018by chiqui3d3 answers
4 reactions

Avoid settings hereditation

Hello, When I add a column(row) and add a background color, this color is added to everything I had previously and also to the next ones you add. Is it really its functionality or is it a bug?

artf

@chiqui3d indeed I've updated the grid system which enables a more natural editing of rows/columns. BTW I still think the example of images is a nice showcase of the "power" of classes and not a "problem"

ryandeba

Hi @chiqui3d, I bet this is happening because the selected component has the same class as other components. Those images from the demo all have the class badge-avatar, so changing one effectively changes them all. I believe it is working...

chiqui3d

@artf Yes you're right, I didn't think of it that way, now I see the meaning.