Issue #2217Opened August 25, 2019by kickbk1 reactions

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">&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, 20191 reactions

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, 20190 reactions

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

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.