Issue #2217💬 AnsweredOpened August 25, 2019by kickbk1 reactions

Grapesjs bootstrap modal

快速解答by kickbk1

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 :)

Read full answer below ↓

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">&times;</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)

kickbkAugust 29, 2019

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 :)

artfAugust 27, 2019

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.

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

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.