GrapesJS / preset-webpage

GrapesJS Plugin Webpage Preset
http://grapesjs.com/demo.html
BSD 3-Clause "New" or "Revised" License
335 stars 291 forks source link

Commands executing multiple times #11

Closed milapshah15 closed 6 years ago

milapshah15 commented 6 years ago

Hello folks,

I need help.After adding grapejs-website-preset.js in my page, commands are executed twice on button click.

Can you please help.

Warm regards Milap

milapshah15 commented 6 years ago

Closing this as it is invalid issue

Warm regards Milap

allmonday commented 6 years ago

@milapshah15 @artf I have same issues: by modifing the script in index.html

      var editor = grapesjs.init({
        height: '100%',
        showOffsets: 1,
        noticeOnUnload: 0,
        storageManager: { autoload: 0 },
        container: '#gjs',
        fromElement: true,

        plugins: ['gjs-preset-webpage'],
        pluginsOpts: {
          'gjs-preset-webpage': {}
        }
      });

      editor.Commands.add('testCommand', {
        run: function (editor, sender) {
          alert("hi");
        }
      })

      editor.Panels.addButton('options', {
        id: 'test',
        className: 'fa fa-trash',
        command: 'testCommand'
      })

it will alert twice, could u show me how you fix it? thx.