mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb7418b51b | ||
|
|
869c4e3219 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "clipboard",
|
"name": "clipboard",
|
||||||
"version": "1.5.11",
|
"version": "1.5.12",
|
||||||
"description": "Modern copy to clipboard. No Flash. Just 2kb",
|
"description": "Modern copy to clipboard. No Flash. Just 2kb",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/clipboard.js",
|
"main": "dist/clipboard.js",
|
||||||
|
|||||||
10
dist/clipboard.js
vendored
10
dist/clipboard.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* clipboard.js v1.5.10
|
* clipboard.js v1.5.12
|
||||||
* https://zenorocha.github.io/clipboard.js
|
* https://zenorocha.github.io/clipboard.js
|
||||||
*
|
*
|
||||||
* Licensed MIT © Zeno Rocha
|
* Licensed MIT © Zeno Rocha
|
||||||
@@ -448,9 +448,10 @@ module.exports = E;
|
|||||||
|
|
||||||
this.removeFake();
|
this.removeFake();
|
||||||
|
|
||||||
this.fakeHandler = document.body.addEventListener('click', function () {
|
this.fakeHandlerCallback = function () {
|
||||||
return _this.removeFake();
|
return _this.removeFake();
|
||||||
}) || true;
|
};
|
||||||
|
this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
|
||||||
|
|
||||||
this.fakeElem = document.createElement('textarea');
|
this.fakeElem = document.createElement('textarea');
|
||||||
// Prevent zooming on iOS
|
// Prevent zooming on iOS
|
||||||
@@ -475,8 +476,9 @@ module.exports = E;
|
|||||||
|
|
||||||
ClipboardAction.prototype.removeFake = function removeFake() {
|
ClipboardAction.prototype.removeFake = function removeFake() {
|
||||||
if (this.fakeHandler) {
|
if (this.fakeHandler) {
|
||||||
document.body.removeEventListener('click');
|
document.body.removeEventListener('click', this.fakeHandlerCallback);
|
||||||
this.fakeHandler = null;
|
this.fakeHandler = null;
|
||||||
|
this.fakeHandlerCallback = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.fakeElem) {
|
if (this.fakeElem) {
|
||||||
|
|||||||
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({
|
Package.describe({
|
||||||
name: "zenorocha:clipboard",
|
name: "zenorocha:clipboard",
|
||||||
summary: "Modern copy to clipboard. No Flash. Just 2kb.",
|
summary: "Modern copy to clipboard. No Flash. Just 2kb.",
|
||||||
version: "1.5.11",
|
version: "1.5.12",
|
||||||
git: "https://github.com/zenorocha/clipboard.js"
|
git: "https://github.com/zenorocha/clipboard.js"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "clipboard",
|
"name": "clipboard",
|
||||||
"version": "1.5.11",
|
"version": "1.5.12",
|
||||||
"description": "Modern copy to clipboard. No Flash. Just 2kb",
|
"description": "Modern copy to clipboard. No Flash. Just 2kb",
|
||||||
"repository": "zenorocha/clipboard.js",
|
"repository": "zenorocha/clipboard.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ class ClipboardAction {
|
|||||||
|
|
||||||
this.removeFake();
|
this.removeFake();
|
||||||
|
|
||||||
this.fakeHandler = document.body.addEventListener('click', () => this.removeFake()) || true;
|
this.fakeHandlerCallback = () => this.removeFake();
|
||||||
|
this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
|
||||||
|
|
||||||
this.fakeElem = document.createElement('textarea');
|
this.fakeElem = document.createElement('textarea');
|
||||||
// Prevent zooming on iOS
|
// Prevent zooming on iOS
|
||||||
@@ -78,8 +79,9 @@ class ClipboardAction {
|
|||||||
*/
|
*/
|
||||||
removeFake() {
|
removeFake() {
|
||||||
if (this.fakeHandler) {
|
if (this.fakeHandler) {
|
||||||
document.body.removeEventListener('click');
|
document.body.removeEventListener('click', this.fakeHandlerCallback);
|
||||||
this.fakeHandler = null;
|
this.fakeHandler = null;
|
||||||
|
this.fakeHandlerCallback = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.fakeElem) {
|
if (this.fakeElem) {
|
||||||
|
|||||||
Reference in New Issue
Block a user