Mailspring/docs/EventedIFrame.html
2015-10-03 13:56:58 -07:00

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&#39;s standard <code>&lt;iframe&gt;</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">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">className</span>=<span class="hljs-value">"file-frame-container"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">EventedIFrame</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">{src}</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">Spinner</span> <span class="hljs-attribute">visible</span>=<span class="hljs-value">{!@state.ready}</span> /&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</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&#39;s document.
This allows <a href='eventediframe.html'>EventedIframe</a> to re-attach it&#39;s event listeners.</p>
</p>
</div>