Add isSupported method #355

This commit is contained in:
Itai Steinherz
2017-02-08 09:36:29 +02:00
committed by Zeno Rocha
parent 402c9ee17b
commit 63d1b0f014
4 changed files with 42 additions and 1 deletions

14
dist/clipboard.js vendored
View File

@ -728,6 +728,20 @@ module.exports = E;
this.clipboardAction = null;
}
}
}], [{
key: 'isSupported',
value: function isSupported() {
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
var actions = typeof action === 'string' ? [action] : action;
var support = !!document.queryCommandSupported;
actions.forEach(function (action) {
support = support && !!document.queryCommandSupported(action);
});
return support;
}
}]);
return Clipboard;

File diff suppressed because one or more lines are too long