mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
add selectedText
This commit is contained in:
5
dist/clipboard.js
vendored
5
dist/clipboard.js
vendored
@@ -407,7 +407,6 @@ module.exports = E;
|
|||||||
/**
|
/**
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function ClipboardAction(options) {
|
function ClipboardAction(options) {
|
||||||
_classCallCheck(this, ClipboardAction);
|
_classCallCheck(this, ClipboardAction);
|
||||||
|
|
||||||
@@ -493,7 +492,7 @@ module.exports = E;
|
|||||||
};
|
};
|
||||||
|
|
||||||
ClipboardAction.prototype.copyText = function copyText() {
|
ClipboardAction.prototype.copyText = function copyText() {
|
||||||
var succeeded = undefined;
|
var succeeded = void 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
succeeded = document.execCommand(this.action);
|
succeeded = document.execCommand(this.action);
|
||||||
@@ -515,6 +514,7 @@ module.exports = E;
|
|||||||
} else {
|
} else {
|
||||||
this.emitter.emit('error', {
|
this.emitter.emit('error', {
|
||||||
action: this.action,
|
action: this.action,
|
||||||
|
text: this.selectedText,
|
||||||
trigger: this.trigger,
|
trigger: this.trigger,
|
||||||
clearSelection: this.clearSelection.bind(this)
|
clearSelection: this.clearSelection.bind(this)
|
||||||
});
|
});
|
||||||
@@ -642,7 +642,6 @@ module.exports = E;
|
|||||||
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function Clipboard(trigger, options) {
|
function Clipboard(trigger, options) {
|
||||||
_classCallCheck(this, Clipboard);
|
_classCallCheck(this, Clipboard);
|
||||||
|
|
||||||
|
|||||||
8
dist/clipboard.min.js
vendored
8
dist/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -130,6 +130,7 @@ class ClipboardAction {
|
|||||||
else {
|
else {
|
||||||
this.emitter.emit('error', {
|
this.emitter.emit('error', {
|
||||||
action: this.action,
|
action: this.action,
|
||||||
|
text: this.selectedText,
|
||||||
trigger: this.trigger,
|
trigger: this.trigger,
|
||||||
clearSelection: this.clearSelection.bind(this)
|
clearSelection: this.clearSelection.bind(this)
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user