mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Merge pull request #216 from sebastianekstrom/master
Use const instead of let when applicable
This commit is contained in:
commit
0163f7cb72
@ -51,7 +51,7 @@ class ClipboardAction {
|
|||||||
* and makes a selection on it.
|
* and makes a selection on it.
|
||||||
*/
|
*/
|
||||||
selectFake() {
|
selectFake() {
|
||||||
let isRTL = document.documentElement.getAttribute('dir') == 'rtl';
|
const isRTL = document.documentElement.getAttribute('dir') == 'rtl';
|
||||||
|
|
||||||
this.removeFake();
|
this.removeFake();
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class Clipboard extends Emitter {
|
|||||||
* @param {Event} e
|
* @param {Event} e
|
||||||
*/
|
*/
|
||||||
onClick(e) {
|
onClick(e) {
|
||||||
let trigger = e.delegateTarget || e.currentTarget;
|
const trigger = e.delegateTarget || e.currentTarget;
|
||||||
|
|
||||||
if (this.clipboardAction) {
|
if (this.clipboardAction) {
|
||||||
this.clipboardAction = null;
|
this.clipboardAction = null;
|
||||||
@ -70,7 +70,7 @@ class Clipboard extends Emitter {
|
|||||||
* @param {Element} trigger
|
* @param {Element} trigger
|
||||||
*/
|
*/
|
||||||
defaultTarget(trigger) {
|
defaultTarget(trigger) {
|
||||||
let selector = getAttributeValue('target', trigger);
|
const selector = getAttributeValue('target', trigger);
|
||||||
|
|
||||||
if (selector) {
|
if (selector) {
|
||||||
return document.querySelector(selector);
|
return document.querySelector(selector);
|
||||||
@ -105,7 +105,7 @@ class Clipboard extends Emitter {
|
|||||||
* @param {Element} element
|
* @param {Element} element
|
||||||
*/
|
*/
|
||||||
function getAttributeValue(suffix, element) {
|
function getAttributeValue(suffix, element) {
|
||||||
let attribute = `data-clipboard-${suffix}`;
|
const attribute = `data-clipboard-${suffix}`;
|
||||||
|
|
||||||
if (!element.hasAttribute(attribute)) {
|
if (!element.hasAttribute(attribute)) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user