mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Adds docs for #368
This commit is contained in:
@ -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');
|
||||
|
Reference in New Issue
Block a user