Issue #1148πŸ’¬ AnsweredOpened May 31, 2018by dwengticorp0 reactions

Script in component get messed up, any idea?

Quick answerby artf

If you use any kind of minifier, the script is affected too. You can set the script as a string if you need to show the complete code to the user

Read full answer below ↓

Question

I created a component like const TWITTERTYPE = 'TWITTER'; domc.addType(TWITTERTYPE, { model: defaultModel.extend({ defaults: { ...defaultModel.prototype.defaults, droppable: false, account: 'OntarioAlliance', widgetwidth: 425, widgetheight: 525, traits: [ { label: 'Account', name: 'account', changeProp: 1, }, { label: 'Width', name: 'widgetwidth', type: 'number', changeProp: 1, }, { label: 'Height', name: 'widgetheight', type: 'number', changeProp: 1, } ], script: function() { if(this.innerHTML.length == 0){ this.innerHTML=<a class="twitter-timeline" data-width="426" data-height="525" data-dn...

Answers (2)

artfβ€’ May 31, 2018

If you use any kind of minifier, the script is affected too. You can set the script as a string if you need to show the complete code to the user

lock[bot]β€’ Sep 17, 2019

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.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.