#2177July 31, 2019by alikabeer323 answers
Can somebody please show me a code example of how to create a block with javascript and css styles. The main problem is that the js code is added right after the html rather than at the end of the file
pouyamiralayi
Hello there! what you are looking for is here editor.DomComponents.addType('custom-type',{ model:{ defaults:{ script: function () { console.log('hello world'); } }, isComponent(){ return true } }, }) you must define the custom type before...
#2176July 31, 2019by yucomds2 answers
Hi, I've this code to display a modal when I click on my custom button. At first click, the modal appears correctly. Then I close it. Now, if I click it again I've this error in console: I'm able to show it again only if I click for another time the custom button. I've already followed the instruction provided here --...
pouyamiralayi
Hello there! I think the problem is not your modal, but it is the first command you are running: testo = editor.runCommand('gjs-get-inlined-html'); you must stop it as well: stop: function (editor) { editor.Modal.close(); editor.stopComman...
yucomds
Thanks @pouyamiralayi !
#2175July 31, 2019by yanosuke2 answers
My customers also require the ability to use the GrapesJS platform on their mobiles, therefore I am currently using the GrapesJS-Touch plugin. The issue, however, is not with the plugin, but rather about a missing method within the GrapesJS code. The issue and solution are provided by Mikereem at the following link: [...
artf
I'd be happy to merge a PR
saltyfoam
We're making use of GrapesJS and would love to have greater support on mobile so I hope this goes through!
#2174July 30, 2019by pouyamiralayiNo answers
Hello there! i am not aware how to send PR please fix this bug here on link on line 31: helper.onclick = () => editor.stopCommand('preview'); must be: helper.onclick = () => editor.stopCommand('core:preview'); i was facing problem with the original one. tnx in advance.
#2173July 30, 2019by Amir28281 answer
Hello all, I would like for some guidance, can anyone shed some light on how is it possible to remove traits from a component dynamically. For example lets say I have a trait that decides on how many more traits will be shown below it. When the number is increased more traits are add and when decreased traits will be...
Amir2828
Never mind I have seen a function has been added to a later version
#2172July 28, 2019by danrcoull3 answers
Hi Not sure if this is the correct place to ask. trying to load the content of a textarea into this framework. But allot of the links have placeholders within the default html such a <a href="{{placeholder for default url }}" is there a way to render this link within the canvas but leave the original html unmodified?
zgover
Your question isn't completely clear are what you're trying to achieve, but take a look at creating components.
pouyamiralayi
hi! for the select model you may use editor.Modal and as it's content, inject your desired logic for choosing and configuring your widgets. then you can inject the result widget using yourComponent.components(yourWidget) to fill the conten...
danrcoull
Sorry Let me explain take a cms widget such as {{widget name="test" type="\Php\Class"}} Concenpt is to drag a block which opens a widget select model to choose a widget set the options and hit add that generates such as above. This needs t...
#2171July 28, 2019by talya-akshotaNo answers
WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdUse the GitHub Issues EXCLUSIVELY for BUGS, FEATURE REQUESTS or QUESTIONS. Prefix the title of the issue with its context, eg. [Bug]: ....Do a quick...
#2170July 26, 2019by inaLar3 answers
Hi, I've created a custom component type, but I am having some trouble making it editable. The component is a "span" with component type "tag". it will contain only text, but I want it to extend the default, not the text component. Any idea how can I make it editable, even if it is not "text".
inaLar
Thank you! I have done something similar, but yours is not so complicated. I've had other events attached to onActive, so I couldn't use it. Now I detached them and I will do as you suggest. About the data-gjs-type - I need it because the...
zgover
What would be your intention and goal of making it editable if you don't intend to extend the text component type? The text component type extends the default type and adds editing capabilities such as the rich text editor. Are you looking...
inaLar
I'd prefer not to use RTE, as I do not need any of its functionality. I only want to be able to edit the content and save it ( by edit I mean - click into the span change the text and save it again). Also the new type will have specific tr...
#2169July 26, 2019by froderf2 answers
I just noticed, it is hard to drag blocks/component from toolbox if the placeholder (a line with yellow green color e.g see it in demo online) is just a lign. Is it possible to make the "yellow green line/placeholder" to become a box and while we are dragging the blocks, this placeholder should take up some space like...
artf
You can change the aspect of the line with your custom CSS but you can't move other components around it, the DOM of the placeholder is like a layer on top of the canvas and not between them
FawadOmerEsk
Can you explain this a little bit as to how can we update the custom CSS?
#2168July 25, 2019by jadejahardipsinh3 answers
I created new toolbar option called text-align using following code In order to make above code work, I added following function into grapes.js file : Due to above code, my changes working in the editor in UI refer: I am getting html of editor using following code : Now, the issue is, in the HTML got using above comma...
artf
Be sure to use the latest version and try to call sync:content on selected component before calling the desired command, eg.
jadejahardipsinh
@artf, Thanks for the answer. I tried with that but unfortunately not working. I am getting that using following code: I already did this but nothing happens. Please correct me if something wrong. Again, highly appreciate your help on this.
artf
@jadejahardipsinh grapesjs version?