From fa3408cfb7a45103e89e41d1c8d93a586a62dfe7 Mon Sep 17 00:00:00 2001 From: jykim Date: Fri, 5 Aug 2016 15:04:31 +0900 Subject: [PATCH] better code --- dist/clipboard.js | 21 ++++++--------------- dist/clipboard.min.js | 2 +- src/clipboard-action.js | 22 ++++++---------------- 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/dist/clipboard.js b/dist/clipboard.js index cec8793..795858b 100644 --- a/dist/clipboard.js +++ b/dist/clipboard.js @@ -504,21 +504,12 @@ module.exports = E; }; ClipboardAction.prototype.handleResult = function 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, - text: this.selectedText, - 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) + }); }; ClipboardAction.prototype.clearSelection = function clearSelection() { diff --git a/dist/clipboard.min.js b/dist/clipboard.min.js index 9bb8813..6e96ec4 100644 --- a/dist/clipboard.min.js +++ b/dist/clipboard.min.js @@ -1 +1 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a