mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
better code
This commit is contained in:
21
dist/clipboard.js
vendored
21
dist/clipboard.js
vendored
@@ -504,21 +504,12 @@ module.exports = E;
|
|||||||
};
|
};
|
||||||
|
|
||||||
ClipboardAction.prototype.handleResult = function handleResult(succeeded) {
|
ClipboardAction.prototype.handleResult = function handleResult(succeeded) {
|
||||||
if (succeeded) {
|
this.emitter.emit(succeeded ? 'success' : 'error', {
|
||||||
this.emitter.emit('success', {
|
action: this.action,
|
||||||
action: this.action,
|
text: this.selectedText,
|
||||||
text: this.selectedText,
|
trigger: this.trigger,
|
||||||
trigger: this.trigger,
|
clearSelection: this.clearSelection.bind(this)
|
||||||
clearSelection: this.clearSelection.bind(this)
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.emitter.emit('error', {
|
|
||||||
action: this.action,
|
|
||||||
text: this.selectedText,
|
|
||||||
trigger: this.trigger,
|
|
||||||
clearSelection: this.clearSelection.bind(this)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ClipboardAction.prototype.clearSelection = function clearSelection() {
|
ClipboardAction.prototype.clearSelection = function clearSelection() {
|
||||||
|
|||||||
2
dist/clipboard.min.js
vendored
2
dist/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -119,22 +119,12 @@ class ClipboardAction {
|
|||||||
* @param {Boolean} succeeded
|
* @param {Boolean} succeeded
|
||||||
*/
|
*/
|
||||||
handleResult(succeeded) {
|
handleResult(succeeded) {
|
||||||
if (succeeded) {
|
this.emitter.emit(succeeded ? 'success' : 'error', {
|
||||||
this.emitter.emit('success', {
|
action: this.action,
|
||||||
action: this.action,
|
text: this.selectedText,
|
||||||
text: this.selectedText,
|
trigger: this.trigger,
|
||||||
trigger: this.trigger,
|
clearSelection: this.clearSelection.bind(this)
|
||||||
clearSelection: this.clearSelection.bind(this)
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.emitter.emit('error', {
|
|
||||||
action: this.action,
|
|
||||||
text: this.selectedText,
|
|
||||||
trigger: this.trigger,
|
|
||||||
clearSelection: this.clearSelection.bind(this)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user