Skip to content

Commit 63d1b0f

Browse files
itaisteinherzzenorocha
authored andcommitted
Add isSupported method zenorocha#355
1 parent 402c9ee commit 63d1b0f

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

dist/clipboard.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,20 @@ module.exports = E;
728728
this.clipboardAction = null;
729729
}
730730
}
731+
}], [{
732+
key: 'isSupported',
733+
value: function isSupported() {
734+
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
735+
736+
var actions = typeof action === 'string' ? [action] : action;
737+
var support = !!document.queryCommandSupported;
738+
739+
actions.forEach(function (action) {
740+
support = support && !!document.queryCommandSupported(action);
741+
});
742+
743+
return support;
744+
}
731745
}]);
732746

733747
return Clipboard;

0 commit comments

Comments
 (0)