add content to integrations/bootstrap.md

This commit is contained in:
r12s
2015-11-12 11:51:34 -08:00
parent c864036ba9
commit f7ee2f47b2
+7 -6
View File
@@ -2,22 +2,23 @@
layout: default
title: Bootstrap Integration
title_nav: Bootstrap
description: How to override the built-in block on `focusin` in Bootstrap dialogs when using TinyMCE.
keywords: integration integrate bootstrap
---
// this article is a work-in-progress
## Using TinyMCE in a Bootstrap Dialog
You need to override the built in block on `focusin` in Bootstrap dialogs when using TinyMCE inside it. See this working example for details.
You need to override the built-in block on `focusin` in Bootstrap dialogs when using TinyMCE inside it. See this working example for details.
Bootstrap blocks all focus events on contents within the dialog. Add this script to your page and it will allow users to click inside the editor.
```js
// Prevent Bootstrap dialog from blocking focusin
$(document).on('focusin', function(e) {
if ($(e.target).closest(".mce-window").length) {
e.stopImmediatePropagation();
}
if ($(e.target).closest(".mce-window").length) {
e.stopImmediatePropagation();
}
});
```
> This document is a work in progress. Click the contribute button (in the blue area above) to improve this page.