Compare commits

...

2 Commits

Author SHA1 Message Date
Zeno Rocha
eb7418b51b Release v1.5.12 2016-06-09 07:57:20 -07:00
Alexander
869c4e3219 Fix bug that unable to remove fake event listener (#256)
* Fix bug that unable to remove fake event listener

* Update dist
2016-06-09 07:54:07 -07:00
6 changed files with 15 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "clipboard",
"version": "1.5.11",
"version": "1.5.12",
"description": "Modern copy to clipboard. No Flash. Just 2kb",
"license": "MIT",
"main": "dist/clipboard.js",

10
dist/clipboard.js vendored
View File

@@ -1,5 +1,5 @@
/*!
* clipboard.js v1.5.10
* clipboard.js v1.5.12
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
@@ -448,9 +448,10 @@ module.exports = E;
this.removeFake();
this.fakeHandler = document.body.addEventListener('click', function () {
this.fakeHandlerCallback = function () {
return _this.removeFake();
}) || true;
};
this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
this.fakeElem = document.createElement('textarea');
// Prevent zooming on iOS
@@ -475,8 +476,9 @@ module.exports = E;
ClipboardAction.prototype.removeFake = function removeFake() {
if (this.fakeHandler) {
document.body.removeEventListener('click');
document.body.removeEventListener('click', this.fakeHandlerCallback);
this.fakeHandler = null;
this.fakeHandlerCallback = null;
}
if (this.fakeElem) {

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
Package.describe({
name: "zenorocha:clipboard",
summary: "Modern copy to clipboard. No Flash. Just 2kb.",
version: "1.5.11",
version: "1.5.12",
git: "https://github.com/zenorocha/clipboard.js"
});

View File

@@ -1,6 +1,6 @@
{
"name": "clipboard",
"version": "1.5.11",
"version": "1.5.12",
"description": "Modern copy to clipboard. No Flash. Just 2kb",
"repository": "zenorocha/clipboard.js",
"license": "MIT",

View File

@@ -49,7 +49,8 @@ class ClipboardAction {
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');
// Prevent zooming on iOS
@@ -78,8 +79,9 @@ class ClipboardAction {
*/
removeFake() {
if (this.fakeHandler) {
document.body.removeEventListener('click');
document.body.removeEventListener('click', this.fakeHandlerCallback);
this.fakeHandler = null;
this.fakeHandlerCallback = null;
}
if (this.fakeElem) {