[QUESTION] New command with a header runs itself?
Question
Hello,
I would like to ask wether my code is ugly and makes my localhost version do something bad or I'm not using the commands add correctly. To be more accurate, wherever I put the 'header index.php', even in an event that shouldn't be executed by itself, I will still be headed to index.php whenever I go on my grapesjs editor.
This is my code:
`editor.Panels.addButton('devices-c', [{
id: 'go-home',
className: 'fa fa-home',
command: 'go-home',
attributes: {
title: 'Go home'
}
},]);`
`editor.Commands.add('go-home', {
run: function(em, sender) {
sender && sender.set('active');
<?php header('Location: ./index.php'); ?>
}
});`
Moreover, I'd like to know how to add the button WHERE I want and not next to the devices buttons, I didn't find any answer on this!
Thanks for reading,
Tanguy.Answers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1112
[Question]How to add a new event to asset images
Hello, is there a way to add a new event to the AssetImageView, something like 'onRemove'. I overwritten the addAsset function from asset m...
Issue #2744
[QUESTION] Disable a block drag&drop
Hello everyone, I would like to make forbidden the drop of one block before another specific one. Context : i've create a new trait for som...
Issue #923
[Question]: Add a select-option to toolbar
I have read the code and only I could find out that there is only a list of ToolbarButton associated with the toolbar. I have a special tra...
Issue #553
Adding new components to existing ones
Hello, I would like to ask if there's any existing support or API for adding new components to an existing component list (e. g. after fetc...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.