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:
9
dist/clipboard.js
vendored
9
dist/clipboard.js
vendored
@@ -283,12 +283,12 @@ module.exports = select;
|
|||||||
|
|
||||||
},{}],7:[function(require,module,exports){
|
},{}],7:[function(require,module,exports){
|
||||||
function E () {
|
function E () {
|
||||||
// Keep this empty so it's easier to inherit from
|
// Keep this empty so it's easier to inherit from
|
||||||
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
|
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
|
||||||
}
|
}
|
||||||
|
|
||||||
E.prototype = {
|
E.prototype = {
|
||||||
on: function (name, callback, ctx) {
|
on: function (name, callback, ctx) {
|
||||||
var e = this.e || (this.e = {});
|
var e = this.e || (this.e = {});
|
||||||
|
|
||||||
(e[name] || (e[name] = [])).push({
|
(e[name] || (e[name] = [])).push({
|
||||||
@@ -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