#444October 23, 2017by ronaldaug3 answers
Hello, First of all, thanks for contributing such an amazing js framework. I am very new to grapesjs. And github too. https://github.com/artf/grapesjs/wiki/Components-&-JS#template-related According to grapesjs wiki, I load js links inside the canvas as the above codes and it works fine. But when I try with css links...
artf
You were almost there :)
ronaldaug
Thank you so much @artf , it works like a charm.
coder-strange
You have to include separately while rendering, it won't come in getHtml() or anything.
#443October 21, 2017by roytang2 answers
We want to define a custom component that may or may not be added into the HTML, but we want to disallow adding more than one of that component. Can this restriction be done in GrapesJS?
artf
Not something built-in, but definitely achievable by using the GrapesJS's API Extremely easy would be adding a listener (eg, change:changesCount), search your component and then apply your logic
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.
#442October 21, 2017by roytang3 answers
We want to create some custom components whose style changes according to an external theme css (there can be different themes), and we want those styles to appear in the canvas while editing.
roytang
Please ignore. I ended up injecting the stylesheet link using javascript into Grapes' canvas' iframe // insert external stylesheet into the grapesjs window var iframes = Utilities_GetElementsByClass("gjs-frame", "IFRAME", document.body); f...
artf
You can inject scripts/styles via canvas config option
#441October 20, 2017by santiph3 answers
Due to https://github.com/artf/grapesjs/issues/436, I cannot rely on StorageManager's Remote Load method to load a template from a REST endpoint, so I'm falling back to alternatives as editor.setComponents() and editor.setStyle() (being used within a command, so grapesjs and editor are available). Unfortunately, those...
artf
Hi @santiph well, if the problem is onbeforeunload you can disable it with noticeOnUnload
santiph
Hi @artf I need to warn the user know of any unsaved changes consistently. And skip it when there's nothing new to be saved: When a new empty template is created, right after saving or right after loading a template, no confirmation messag...
santiph
I could test it with remote storage fully: onbeforeunload is disabled, as expected, on closing right after saving. Unfortunately, it's still being displayed on closing right after loading a new template. After a little debugging, loading a...
#440October 20, 2017by ateshuseyin3 answers
I use jquery in my project. After version 0.12.8 it does not work with jquery. Prt of my webpack.config is; When I try to drop a block it throws;ComponentsView.js:76 Uncaught TypeError: Cannot read property 'length' of undefined at child.addToCollection (ComponentsView.js:76) at child.addTo (ComponentsView.js:22) at t...
artf
Do you get the same error with all of your blocks? Even with some official one?
ateshuseyin
Right. I get the same error with all blocks defined in mjml plugin.
artf
Ok, I'd like to understand if it's something related to jquery. Are you able to reproduce it without the mjml plugin? (latest version)
#439October 20, 2017by ateshuseyin3 answers
In my machine grapesjs is unstable. Generally at first request throws below error. After refreshing one or two times, it works. Bug exists in all versions I used.Uncaught TypeError: Cannot read property 'componentTypes' of undefined at F.i.renderChildren (grapes.min.js:2) at F.i.render (grapes.min.js:2) at F.i.addToCo...
ateshuseyin
I found the problem. One of my chrome extension (I think it is Backbone Inspector) causes the problem. Issue can be closed
ateshuseyin
Another error is;components.js:169 Uncaught TypeError: Cannot read property 'defaultTypes' of undefined at child.renderChildren (components.js:169) at child.render (components.js:212) at child.addToCollection (ComponentsView.js:65) at Comp...
artf
Weird, never got those issues, but if you see defaultTypes in components.js you're definitely working with an old version of grapesjs
#438October 19, 2017by Geczy3 answers
All I did was import HTML, except I can't modify the text in the HTML I can't type anything or remove any text
Geczy
This is the HTML that I am using https://pastebin.com/wNseLeqh is it because text is not wrapped in <p> ?
artf
This happens because td component is not editable, so the easiest solution would be, as you already get it, to wrap it inside some other component. Otherwise, you should extend the TableCell
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.
#436October 19, 2017by santiph3 answers
I'm using a custom module to save/load a template with a service like this: Save is a different module and works just fine. The problem is with the Load() call. For some reason, Grapes performs a POST action to localhost:8000/templates/5 getting a 405 - Method not allowed from the backend. Fetch call in RemoteStorage...
suresh5
hi can you share me the json when u are sending to load template ?
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.
#434October 19, 2017by vandanaqburst2 answers
Vendor prefixes getting truncated on calling setComponents.
artf
This is due to the browser's parser, I've already added the possibility to set a custom one to the Roadmap
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.
#433October 18, 2017by cindygao933 answers
I downloaded the git repo but was only able to find grapes.min.js. I really want to dig into the code some more and get a better understanding of how all the files are related to each other but I'm not seeing the unminified version anywhere. Could someone point me to where it is in the repo or if not, could the unmini...
ateshuseyin
There is no unminified version of grapesjs. I think this is a necessity. Until @artf add unminified version checkout the project then link grapesjs into your project. See: https://docs.npmjs.com/cli/link
artf
Hi @cindygao93 if you want to dig into the code you just have to check /src folder
z-vr
@artf /src is a good start, but does not allow to do