mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c3bce265f | ||
|
|
3c0dfe5a38 | ||
|
|
f960b0d20a | ||
|
|
b6e6b80ab0 | ||
|
|
a55c9ac513 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "clipboard",
|
||||
"version": "1.7.0",
|
||||
"version": "1.7.1",
|
||||
"description": "Modern copy to clipboard. No Flash. Just 2kb",
|
||||
"license": "MIT",
|
||||
"main": "dist/clipboard.js",
|
||||
|
||||
6
dist/clipboard.js
vendored
6
dist/clipboard.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* clipboard.js v1.7.0
|
||||
* clipboard.js v1.7.1
|
||||
* https://zenorocha.github.io/clipboard.js
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
@@ -522,8 +522,8 @@ module.exports = E;
|
||||
}, {
|
||||
key: 'clearSelection',
|
||||
value: function clearSelection() {
|
||||
if (this.target) {
|
||||
this.target.blur();
|
||||
if (this.trigger) {
|
||||
this.trigger.focus();
|
||||
}
|
||||
|
||||
window.getSelection().removeAllRanges();
|
||||
|
||||
4
dist/clipboard.min.js
vendored
4
dist/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@
|
||||
Package.describe({
|
||||
name: "zenorocha:clipboard",
|
||||
summary: "Modern copy to clipboard. No Flash. Just 2kb.",
|
||||
version: "1.7.0",
|
||||
version: "1.7.1",
|
||||
git: "https://github.com/zenorocha/clipboard.js"
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "clipboard",
|
||||
"version": "1.7.0",
|
||||
"version": "1.7.1",
|
||||
"description": "Modern copy to clipboard. No Flash. Just 2kb",
|
||||
"repository": "zenorocha/clipboard.js",
|
||||
"license": "MIT",
|
||||
|
||||
10
readme.md
10
readme.md
@@ -119,7 +119,13 @@ clipboard.on('error', function(e) {
|
||||
});
|
||||
```
|
||||
|
||||
For a live demonstration, open this [site](https://clipboardjs.com/) and just your console :)
|
||||
For a live demonstration, go to this [site](https://clipboardjs.com/) and open your console.
|
||||
|
||||
## Tooltips
|
||||
|
||||
Each application has different design needs, that's why clipboard.js does not include any CSS or built-in tooltip solution.
|
||||
|
||||
The tooltips you see on the [demo site](https://clipboardjs.com/) were built using [GitHub's Primer](https://github.com/primer/primer-css/tree/master/modules/primer-tooltips). You may want to check that out if you're looking for a similar look and feel.
|
||||
|
||||
## Advanced Options
|
||||
|
||||
@@ -149,7 +155,7 @@ For use in Bootstrap Modals or with any other library that changes the focus you
|
||||
|
||||
```js
|
||||
new Clipboard('.btn', {
|
||||
container: document.getElementById('#modal')
|
||||
container: document.getElementById('modal')
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
@@ -131,11 +131,11 @@ class ClipboardAction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes current selection and focus from `target` element.
|
||||
* Moves focus away from `target` and back to the trigger, removes current selection.
|
||||
*/
|
||||
clearSelection() {
|
||||
if (this.target) {
|
||||
this.target.blur();
|
||||
if (this.trigger) {
|
||||
this.trigger.focus();
|
||||
}
|
||||
|
||||
window.getSelection().removeAllRanges();
|
||||
|
||||
Reference in New Issue
Block a user