mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Using template strings
This commit is contained in:
parent
14c5962816
commit
bd031ad7a5
15
dist/clipboard.js
vendored
15
dist/clipboard.js
vendored
@ -534,11 +534,12 @@ var Clipboard = (function (_Emitter) {
|
||||
*/
|
||||
|
||||
Clipboard.prototype.setAction = function setAction(trigger) {
|
||||
if (!trigger.hasAttribute(prefix + 'action')) {
|
||||
var attr = prefix + 'action';
|
||||
if (!trigger.hasAttribute(attr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return trigger.getAttribute(prefix + 'action');
|
||||
return trigger.getAttribute(attr);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -547,11 +548,12 @@ var Clipboard = (function (_Emitter) {
|
||||
*/
|
||||
|
||||
Clipboard.prototype.setTarget = function setTarget(trigger) {
|
||||
if (!trigger.hasAttribute(prefix + 'target')) {
|
||||
var attr = prefix + 'target';
|
||||
if (!trigger.hasAttribute(attr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var target = trigger.getAttribute(prefix + 'target');
|
||||
var target = trigger.getAttribute(attr);
|
||||
return document.querySelector(target);
|
||||
};
|
||||
|
||||
@ -561,11 +563,12 @@ var Clipboard = (function (_Emitter) {
|
||||
*/
|
||||
|
||||
Clipboard.prototype.setText = function setText(trigger) {
|
||||
if (!trigger.hasAttribute(prefix + 'text')) {
|
||||
var attr = prefix + 'text';
|
||||
if (!trigger.hasAttribute(attr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return trigger.getAttribute(prefix + 'text');
|
||||
return trigger.getAttribute(attr);
|
||||
};
|
||||
|
||||
return Clipboard;
|
||||
|
2
dist/clipboard.min.js
vendored
2
dist/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
@ -62,11 +62,12 @@ class Clipboard extends Emitter {
|
||||
* @param {Element} trigger
|
||||
*/
|
||||
setAction(trigger) {
|
||||
if (!trigger.hasAttribute(prefix + 'action')) {
|
||||
let attr = `${prefix}action`;
|
||||
if (!trigger.hasAttribute(attr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return trigger.getAttribute(prefix + 'action');
|
||||
return trigger.getAttribute(attr);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,11 +75,12 @@ class Clipboard extends Emitter {
|
||||
* @param {Element} trigger
|
||||
*/
|
||||
setTarget(trigger) {
|
||||
if (!trigger.hasAttribute(prefix + 'target')) {
|
||||
let attr = `${prefix}target`;
|
||||
if (!trigger.hasAttribute(attr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let target = trigger.getAttribute(prefix + 'target');
|
||||
let target = trigger.getAttribute(attr);
|
||||
return document.querySelector(target);
|
||||
}
|
||||
|
||||
@ -87,11 +89,12 @@ class Clipboard extends Emitter {
|
||||
* @param {Element} trigger
|
||||
*/
|
||||
setText(trigger) {
|
||||
if (!trigger.hasAttribute(prefix + 'text')) {
|
||||
let attr = `${prefix}text`;
|
||||
if (!trigger.hasAttribute(attr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return trigger.getAttribute(prefix + 'text');
|
||||
return trigger.getAttribute(attr);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user