Removes error message when target/text attributes are null, undefined, or false

This commit is contained in:
Zeno Rocha
2016-04-03 22:16:22 -07:00
parent 0163f7cb72
commit 7a5a910bcd
2 changed files with 1 additions and 30 deletions

View File

@@ -32,18 +32,12 @@ class ClipboardAction {
* on the existence of `text` and `target` properties.
*/
initSelection() {
if (this.text && this.target) {
throw new Error('Multiple attributes declared, use either "target" or "text"');
}
else if (this.text) {
if (this.text) {
this.selectFake();
}
else if (this.target) {
this.selectTarget();
}
else {
throw new Error('Missing required attributes, use either "target" or "text"');
}
}
/**