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) {
|
constructor(options) {
|
||||||
this.action = options.action;
|
this.action = options.action;
|
||||||
this.host = options.host;
|
this.emitter = options.emitter;
|
||||||
this.target = options.target;
|
this.target = options.target;
|
||||||
this.text = options.text;
|
this.text = options.text;
|
||||||
this.trigger = options.trigger;
|
this.trigger = options.trigger;
|
||||||
|
@ -103,7 +103,7 @@ class ClipboardAction {
|
||||||
*/
|
*/
|
||||||
handleResult(succeeded) {
|
handleResult(succeeded) {
|
||||||
if (succeeded) {
|
if (succeeded) {
|
||||||
this.host.emit('success', {
|
this.emitter.emit('success', {
|
||||||
action: this.action,
|
action: this.action,
|
||||||
text: this.selectedText,
|
text: this.selectedText,
|
||||||
trigger: this.trigger,
|
trigger: this.trigger,
|
||||||
|
@ -111,7 +111,7 @@ class ClipboardAction {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.host.emit('error', {
|
this.emitter.emit('error', {
|
||||||
action: this.action,
|
action: this.action,
|
||||||
trigger: this.trigger,
|
trigger: this.trigger,
|
||||||
clearSelection: this.clearSelection.bind(this)
|
clearSelection: this.clearSelection.bind(this)
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Clipboard extends Emitter {
|
||||||
target : e.delegateTarget.getAttribute('data-target'),
|
target : e.delegateTarget.getAttribute('data-target'),
|
||||||
text : e.delegateTarget.getAttribute('data-text'),
|
text : e.delegateTarget.getAttribute('data-text'),
|
||||||
trigger : e.delegateTarget,
|
trigger : e.delegateTarget,
|
||||||
host : this
|
emitter : this
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user