#998April 3, 2018by tonygiang3 answers
Description: GrapesJS editor is initialized in an editor.html file as follows: localhost:9001 is a local IIS server running PHP5. The content of uploadimage.php is as follows: Since images uploaded from GrapesJS is expected to be in the $FILES array, I dump all of its content to a log file everytime a request reaches...
artf
What about the client-side? Do you see the upload request correctly (eg. from the inspector)?
no-response[bot]
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take ac...
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.
#997April 3, 2018by alimajed932 answers
Hello everyone, I noticed that if the size of the screen is smaller than height of modal, the modal is cropped, and the user cannot scroll to the bottom of the modal, in other words, a part of the modal becomes unaccessible. The following attached image shows how the image block modal is cropped (one small part of the...
artf
This behavior was just adapted for the demo (where there is shouldn't be an issue with the size) you can tweak it easily with CSS
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.
#996April 3, 2018by HarshOB3 answers
Now, let's consider that I wrote new into the trait value but in attribute :items, I want to append prefix like item.text. to that value So, my final attribute :items become item.text.new. Is that possible?
artf
I'd say it's enough just this
artf
You should be able to achieve it via a custom trait, eg. by overriding getValueForTarget method
HarshOB
I tried creating custom trait and override a method but didn't see any attribute generated. can you please look at this code and correct me if there's any error. When I write data in traits it should generate attribute as ':text=item.text....
#995April 3, 2018by sublimekaushik2 answers
I am building the trait when the application starts. so getting the below fields at side bar as settings Now I want more field to be loaded (in the below picture 'product' and 'Product Image' ) along with previously loaded field ('Logo Url', 'Redirect Url'). And these two fields('product' and 'Product Image' ) will be...
artf
In your case, you have to update all those models model.get('traits').add([{name: 'product'}, {...}])
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.
#994April 3, 2018by crazyxhz3 answers
For example I have two blocks A and B that I want to drop to the editor canvas. But sometimes the block that dropped later become the child of existing block. That is A>B layout. But I want to force the blocks can only be the sibling level.eg. A+B How can I do that? Maybe component:add event?
crazyxhz
@anand-gopinath cool~ work like a charm. Now I found many data attributes usage.... It is a very good framework but the doc is lag behind...
anand-gopinath
@crazyxhz : You can do it by adding data attributes to the content "data-gjs-droppable='.className'", For ex https://jsfiddle.net/wswvuvab/2/
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.
#993April 3, 2018by duccanh00223 answers
Hi, I have a problem: When I copy and paste email template (http://www.charlesmudy.com/respmail/ - I used gjs-open-import-webpage plugin). Save to db ...seen everything OK. Editor: <img width="1277" alt="screen shot 2018-04-03 at 11 16 19" src="https://user-images.githubusercontent.com/4942484/38228973-7cf40f60-3730-1...
artf
So when you refresh the page the load request is sent, right? Try to see what you get from these listeners
duccanh0022
Hi, thanks for reply. Finally, I have found my bug. Component field in mysql database is TEXT type not enough space. I changed to LONGTEXT. Everything seem OK. Thanks again!
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.
#992April 2, 2018by vladbpython2 answers
Good day, May I show all hidden (display:none) divs in template in editor? for example fancybox, help with logic please.
artf
eg. editor.DomComponents.getWrapper().find('.some-query').forEach(model => model.setStyle({display: ...}))
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.
#991April 1, 2018by belal-azzam3 answers
hi. i was trying to implement uploading videos using the image element with the asset manager i stopped at the step where i wanted to replace the img tag with a video tag in the updateTarget call back, i am asking if there is an easy way for implementing that? thanks in advance. here is a snippet from my code
usman-vqode
You can just add it to the video by using the asset manager... this.editor.on('component:create', model => { if (model.get('type') === 'video') { this.editor.runCommand('open-assets', { target: model }); } });
artf
You can update the tag name of the component in this way model.set('tagName', 'new-tag')
artf
@ecmascriptguru I would rather suggest to extend the video component and implement the modal (like in ComponentImageView)
#990April 1, 2018by anand-gopinath2 answers
@artf @arthuralmeidap @nojacko I have a custom component like, this and i the code looks like https://jsfiddle.net/nganand/n97g7g43/ . How to listen to an event when custom component's property changed (Ex, when styling padding/margin)? like init() { this.listenTo(this.model, "component:styleUpdate:text-align", this.h...
artf
For component's properties use this.listenTo(this.model, "change:prop-name" ...By doing ...attributes.align = "left" Component doesn't see your changes, use instead this.model.components().at(0).addAttributes({ align: 'left' }), you don't...
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.
#989March 29, 2018by tommedema3 answers
I've spent the greater part of an afternoon trying to debug this. While I have reduced this to a small and easy to reproduce test case, I didn't find the root cause of this issue yet. Hopefully someone can help. Note the following HTML template: If you render this in a browser, it renders as: <img width="133" alt="scr...
artf
Yeah Tom thanks, I think a configurable option (eg. keepWhitespace?!?) might be a good solution
artf
This is due to the node cleaning while traversing https://github.com/artf/grapesjs/blob/dev/src/parser/model/ParserHtml.js#L155-L158
tommedema
Thanks @artf, I see. I would suggest removing this or at least making this configurable (defaulting to true then to prevent breaking changes). Would you accept a PR for this?