Issue #1127Opened May 24, 2018by milapshah150 reactions

Command running multiple times

Question

Hello Folks,

I need your help.I created a custom button on the commands Panel to publish the site created from Grapes.When i click on it, it executes the command 2 times and I am not sure why

Code SnippetTEXT
Here is my code snippet.Any help would be really appreciated.

            //Get the default plugin set for all the blocks
            plugins: ['gjs-preset-webpage'],
            pluginsOpts: {
                'gjs-preset-webpage': { /* options */ }
            },

            //Commands
            commands: {
                defaults: [{
                    id: 'publishContent',
                    run: function (editor, senderBtn) {
                        publish(editor.getHtml(), editor.getCss());
                    },
                    stop: function (editor, senderBtn) {},
                }],
            },

        });

 //Manipulate existing panels
        var panelManager = editor.Panels;

        //get Panel Object
        var panelObj = panelManager.getPanel('options');

        //publish button to publish the website
        var publishButton = panelManager.addButton('options', {
            id: 'publish',
            className: 'fa fa-upload',
            command: 'publishContent',
            attributes: {
                title: 'Publish Site'
            },
            active: false,
        });`






Warm regards
Milap

Answers (3)

milapshah15May 24, 20180 reactions

@artf Can you please help on this.

milapshah15May 24, 20180 reactions

@shareefhiasat if you see my code, I guess that issue is different than what I am facing.Moreover, I see that I face the issue when I load website-preset plugin

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.