mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
39 lines
1.7 KiB
HTML
39 lines
1.7 KiB
HTML
---
|
|
layout: docs
|
|
title: EventedIFrame
|
|
edit_url: "https://github.com/nylas/N1/blob/master/src/components/evented-iframe.cjsx"
|
|
---
|
|
|
|
<h2>Summary</h2>
|
|
|
|
<div class="markdown-from-sourecode">
|
|
<p><p>EventedIFrame is a thin wrapper around the DOM's standard <code><iframe></code> element.
|
|
You should always use EventedIFrame, because it provides important event hooks that
|
|
ensure keyboard and mouse events are properly delivered to the application when
|
|
fired within iFrames.</p>
|
|
<pre><code><span class="hljs-tag"><<span class="hljs-title">div</span> <span class="hljs-attribute">className</span>=<span class="hljs-value">"file-frame-container"</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-title">EventedIFrame</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">{src}</span> /></span>
|
|
<span class="hljs-tag"><<span class="hljs-title">Spinner</span> <span class="hljs-attribute">visible</span>=<span class="hljs-value">{!@state.ready}</span> /></span>
|
|
<span class="hljs-tag"></<span class="hljs-title">div</span>></span>
|
|
</code></pre><p>Any <code>props</code> added to the <EventedIFrame> are passed to the iFrame it renders.</p>
|
|
</p>
|
|
</div>
|
|
|
|
<ul>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Instance Methods</h3>
|
|
|
|
<h4 id=documentWasReplaced class="function-name">
|
|
documentWasReplaced(<span class="args"></span>) <a href="#documentWasReplaced" class="link"></a>
|
|
</h4>
|
|
|
|
<div class="function-description markdown-from-sourecode">
|
|
<p><p>Call this method if you replace the contents of the iframe's document.
|
|
This allows <a href='eventediframe.html'>EventedIframe</a> to re-attach it's event listeners.</p>
|
|
</p>
|
|
</div>
|