I'm building a a new trait type, and would like to be able to include the grapesjs color picker inside it - any suggestions on how to do that? Right now I'm including the standard HTML color input in my "inputEl" html (along with a text field and radio button) but I would love to be able to use the one that comes with...
pnellesen
@nojacko I've modified my code a little, here's basically what I'm doing: Hope this helps. This is still a work in progress :) Note that the getInputEl method of the colorPicker appends a spectrum colorpicker to the body of the canvas each...
artf
Hi @pnellesen this is actually a really good question, definitely, we should allow doing so but unfortunately, right now it's not so straightforward. We should refactor few modules to make the UI more reusable. BTW try to extend editor.Tra...
pnellesen
@artf - thanks for the response! Your suggestion worked pretty well (and it even works in Internet Explorer, which is better than my html5 color picker :p ). I have some tweaks to do to my styling and my input data, but otherwise it's good...
Hey @artf , thanks for the enhancement! The implementation works as expected with some properties (font-size, border-radius, ...), but not with others (line-height, border-width, ...). I created a example/demo where it's visible that the configuration is the same in both scenarios, however the unit doesn't apply in th...
artf
I created a example/demo where it's visible that the configuration is the same in both scenarios Actually, you didn't indicate the defaults, where in case of line-height takes normal by default and so resets its unit on initialization
FrciSmrci
@artf I think that this specific fix messed up the properties without units, like Opacity. The slider behaves weirdly in this case, even on the demo.
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.
I want to keep the Asset Manager as long as possible if the user didn't select an image, how can I prevent the event bubbling from happening when I press the close button on this specific modal? Also, is there a way to change the click event when selecting an asset?
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.
This is the component I try to add in Editor. <div class="page"> <div class="col1"></div> <div class="col2"></div> </div> After adding those components I try to add some computed values to the elements like this, element.on('component:add',function(ele){ ele.addAttributes({ 'data-top' : topOffset, 'data-left' : leftOf...
artf
Check here all the methods available for components: https://grapesjs.com/docs/api/component.html Btw you would 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.
I want to read the resize event when an element is triggered for resizing. My current Code looks like this, editor.on("component:resize", function(model) { console.log('model',model); }); But, It is not working . Is there any option to do this?
arthuralmeidap
Since the resize is just changing the value for width and/or height I haven't tried but I think you could try with the event styleManager:change:{propertyName} Take a look here for available events: https://grapesjs.com/docs/api/editor.htm...
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.
hiοΌI saved an object in the custom propertyγ And I want to implement putting values into custom propertiesγ but It will cover the previous one
arthuralmeidap
so, in the second case do you want to update the same data-info attribute with a new key, right? since data-info has a string as a type value, first you need to get it and parse to an object. const dataInfoObject = JSON.parse(this.model.ge...
artf
I thinks he's just looking for addAttributes
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.
hiii, i use latest grapesjs with newsletter preset plugins, but when i drag & drop button control only view text this my code: <script type="text/javascript"> var images = []; var editor = grapesjs.init({ clearOnRender: true, storageManager: { id: 'gjs-nl-', }, assetManager: { assets: images, upload: 0, uploadText: 'N...
artf
Styles of those blocks are defined here, you can copy them or define your own
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.
hi @arthuralmeidap i want to override font awesome icons of panel "views" say style manager i want to replace icon with my "svg" icon .Can you please help to sort-out the things this is how i tried but it'll not reflect any changes. Thanks
arthuralmeidap
any luck?
Abhisheknanda1344463
???? @arthuralmeidap i tried to do that many times but still failed.Can you please help me out?
@artf I want to include a custom embed code in Video component so that user can add any iframe containing video. Any help would be appreciated. eg:- <iframe width="640" height="360" src="//player.vimeo.com/video/123456789?autoplay=0&title=0&byline=0&wmode=transparent" frameborder="0" allowfullscreen="" wmode="opaque">...
artf
You can update the video component by adding a new text trait which adds this functionality or you can use https://github.com/artf/grapesjs-custom-code
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.