Adds docs for #368

This commit is contained in:
Zeno Rocha
2017-05-29 14:22:26 -07:00
parent 2c27fbdc27
commit 10468f0c0a

View File

@ -169,6 +169,12 @@ clipboard.on('error', function(e) {
}
});</code></pre>
<p>For use in Bootstrap Modals or with any other library that changes the focus you'll want to set the focused element as the <code>container</code> value.</p>
<pre class="snippet"><code class="js">new Clipboard('.btn', {
container: document.getElementById('#modal')
});</code></pre>
<p>Also, if you are working with single page apps, you may want to manage the lifecycle of the DOM more precisely. Here's how you clean up the events and objects that we create.</p>
<pre class="snippet"><code class="js">var clipboard = new Clipboard('.btn');