mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Renames host argument to emitter
This commit is contained in:
parent
aa6cc8e4df
commit
e3f69de585
@ -8,7 +8,7 @@ class ClipboardAction {
|
||||
*/
|
||||
constructor(options) {
|
||||
this.action = options.action;
|
||||
this.host = options.host;
|
||||
this.emitter = options.emitter;
|
||||
this.target = options.target;
|
||||
this.text = options.text;
|
||||
this.trigger = options.trigger;
|
||||
@ -103,7 +103,7 @@ class ClipboardAction {
|
||||
*/
|
||||
handleResult(succeeded) {
|
||||
if (succeeded) {
|
||||
this.host.emit('success', {
|
||||
this.emitter.emit('success', {
|
||||
action: this.action,
|
||||
text: this.selectedText,
|
||||
trigger: this.trigger,
|
||||
@ -111,7 +111,7 @@ class ClipboardAction {
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.host.emit('error', {
|
||||
this.emitter.emit('error', {
|
||||
action: this.action,
|
||||
trigger: this.trigger,
|
||||
clearSelection: this.clearSelection.bind(this)
|
||||
|
@ -31,7 +31,7 @@ class Clipboard extends Emitter {
|
||||
target : e.delegateTarget.getAttribute('data-target'),
|
||||
text : e.delegateTarget.getAttribute('data-text'),
|
||||
trigger : e.delegateTarget,
|
||||
host : this
|
||||
emitter : this
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user