From 76b907949c90adbfa12e8940bf4512c7d7b85dba Mon Sep 17 00:00:00 2001 From: JY Kim Date: Fri, 9 Sep 2016 00:57:41 +0900 Subject: [PATCH] issue #282 solution (#283) * add selectedText * better code * remove dist folder * Revert "remove dist folder" This reverts commit 50e726c7a790a1c4a76469e15b56baccc44a4599. * orogin dist source --- src/clipboard-action.js | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/clipboard-action.js b/src/clipboard-action.js index 73903e5..074aad8 100644 --- a/src/clipboard-action.js +++ b/src/clipboard-action.js @@ -119,21 +119,12 @@ class ClipboardAction { * @param {Boolean} succeeded */ handleResult(succeeded) { - if (succeeded) { - this.emitter.emit('success', { - action: this.action, - text: this.selectedText, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }); - } - else { - this.emitter.emit('error', { - action: this.action, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }); - } + this.emitter.emit(succeeded ? 'success' : 'error', { + action: this.action, + text: this.selectedText, + trigger: this.trigger, + clearSelection: this.clearSelection.bind(this) + }); } /**