Grapesjs bootstrap modal
Question
How do we go about replacing the grapesjs modal with a bootstrap modal? For example, say I want to open the export modal of the MJML lib. I created the html element in my view:
<div class="modal fade" id="export-template" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="updatePasswordLabel">Export template</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col">
<div id="exportModalContent"></div>
</div>
</div>
</div>
</div>
</div>
</div>
Then I override command-export-mjml.js with
const container = document.getElementById("exportModalContent");
and
$("#export-template").modal('show');
modal.open();
But this opens both BS modal and grapesjs modal, yet the grapesjs modal is outside the BS modal.
Answers (2)
I managed to make it work, but honestly it was just not worth the trouble since the export modal looks better with the original grapesjs modal :)
Actually, we don't have any public API to extend the built-in modal.
BTW, did you try just not calling modal.open()?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1588
[QUESTION]
Hi guys and thank you for your magnificent work and this API! I have a question about the box, which wraps all components after saving. For...
Issue #399
[Question] Can i push toolbar in current modal and current modal child?
Hello again @artf , i confuse about push toolbar in the element with specific class (ex: modal-trigger) the element code is : and in the /s...
Issue #3135
[Help Wanted] How to easily override existing component ?
For example, I want to add a double click event handler on the default video component to open the assets manager. My basic idea was to get...
Issue #422
Prevent editing some components
I would like to prevent users from editing the internal components of specific components. IE lets say I have an element called Drupal-Bloc...
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.