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 | |
|---|---|---|---|
|
|
fddd2aac5f | ||
|
|
e430d056ad |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "clipboard",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.6",
|
||||
"description": "Modern copy to clipboard. No Flash. Just 3kb",
|
||||
"license": "MIT",
|
||||
"main": "dist/clipboard.js",
|
||||
|
||||
6
dist/clipboard.js
vendored
6
dist/clipboard.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* clipboard.js v2.0.5
|
||||
* clipboard.js v2.0.6
|
||||
* https://clipboardjs.com/
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
@@ -936,10 +936,10 @@ var clipboard_Clipboard = function (_Emitter) {
|
||||
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
|
||||
|
||||
var actions = typeof action === 'string' ? [action] : action;
|
||||
var support = !document.queryCommandSupported;
|
||||
var support = !!document.queryCommandSupported;
|
||||
|
||||
actions.forEach(function (action) {
|
||||
support = support && !document.queryCommandSupported(action);
|
||||
support = support && !!document.queryCommandSupported(action);
|
||||
});
|
||||
|
||||
return support;
|
||||
|
||||
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 3kb.",
|
||||
version: "2.0.5",
|
||||
version: "2.0.6",
|
||||
git: "https://github.com/zenorocha/clipboard.js"
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "clipboard",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.6",
|
||||
"description": "Modern copy to clipboard. No Flash. Just 2kb",
|
||||
"repository": "zenorocha/clipboard.js",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -86,10 +86,10 @@ class Clipboard extends Emitter {
|
||||
*/
|
||||
static isSupported(action = ['copy', 'cut']) {
|
||||
const actions = (typeof action === 'string') ? [action] : action;
|
||||
let support = !document.queryCommandSupported;
|
||||
let support = !!document.queryCommandSupported;
|
||||
|
||||
actions.forEach((action) => {
|
||||
support = support && !document.queryCommandSupported(action);
|
||||
support = support && !!document.queryCommandSupported(action);
|
||||
});
|
||||
|
||||
return support;
|
||||
|
||||
@@ -110,12 +110,12 @@ describe('Clipboard', () => {
|
||||
|
||||
describe('#static isSupported', () => {
|
||||
it('should return the support of the given action', () => {
|
||||
assert.equal(Clipboard.isSupported('copy'), false);
|
||||
assert.equal(Clipboard.isSupported('cut'), false);
|
||||
assert.equal(Clipboard.isSupported('copy'), true);
|
||||
assert.equal(Clipboard.isSupported('cut'), true);
|
||||
});
|
||||
|
||||
it('should return the support of the cut and copy actions', () => {
|
||||
assert.equal(Clipboard.isSupported(), false);
|
||||
assert.equal(Clipboard.isSupported(), true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user