Giter Site home page Giter Site logo

Comments (9)

YannikFirre avatar YannikFirre commented on July 26, 2024 3

Hello @artf

I have the same issue but only at the initialization after the command work fine.

/*! grapesjs - 0.16.12 /
/
! grapesjs-preset-newsletter - 0.2.20 */

editor = grapesjs.init({
   container: '#gjs',
   plugins: ['gjs-preset-newsletter'],
   pluginsOpts: {
      'gjs-preset-newsletter': {
       }
   },
});

// Doesn't work
editor.runCommand('gjs-get-inlined-html')

editor.on('change:changesCount', e => {
    // Work after first edition
    editor.runCommand('gjs-get-inlined-html')
});

Thanks :)

from preset-newsletter.

LKozakewycz avatar LKozakewycz commented on July 26, 2024 2

Worked it out:

var editor = grapesjs.init({
// ...
});

console.log(editor.Commands.get('gjs-get-inlined-html').run(editor));

from preset-newsletter.

AnkitKachhadiya avatar AnkitKachhadiya commented on July 26, 2024 2

You can also do like this:

var editor = grapesjs.init({
// ...
});
console.log(editor.runCommand('gjs-get-inlined-html'));

from preset-newsletter.

artf avatar artf commented on July 26, 2024 1

editor.runCommand('gjs-get-inlined-html') works in the demo (you can try it in dev console). Be sure to use the latest version

from preset-newsletter.

LKozakewycz avatar LKozakewycz commented on July 26, 2024
var editor = grapesjs.init({
// ...
});

console.log(editor.Commands.get('gjs-get-inlined-html'));

That works. My concern now is how I actually get the HTML. This returns an object.

from preset-newsletter.

carboni-rob avatar carboni-rob commented on July 26, 2024

It's returning undefined for me. Any idea why?
Also, editor.Commands.has('gjs-get-inlined-html') returns false.
grapesjs 0.14.27
grapesjs-preset-newsletter 0.2.19

from preset-newsletter.

zolga avatar zolga commented on July 26, 2024

I'm getting undefined as well, any update on this?

from preset-newsletter.

chezhiane avatar chezhiane commented on July 26, 2024

getting undefined as well any reasons ?

from preset-newsletter.

yatide avatar yatide commented on July 26, 2024

Same here

from preset-newsletter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.