|
|
|
@ -14,8 +14,8 @@ var css = csjs` |
|
|
|
|
} |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
module.exports = function copyToClipboard (getContent) { |
|
|
|
|
var copyIcon = yo`<i title="Copy value to clipboard" class="${css.copyIcon} fa fa-clipboard" aria-hidden="true"></i>` |
|
|
|
|
module.exports = function copyToClipboard (getContent, tip = 'Copy value to to clipboard', icon = 'fa-clipboard') { |
|
|
|
|
var copyIcon = yo`<i title="${tip}" class="${css.copyIcon} fa ${icon}" aria-hidden="true"></i>` |
|
|
|
|
copyIcon.style.color = styles.remix.icon_Color_CopyToClipboard |
|
|
|
|
copyIcon.onmouseenter = function (event) { copyIcon.style.color = styles.remix.icon_HoverColor_CopyToClipboard } |
|
|
|
|
copyIcon.onmouseleave = function (event) { copyIcon.style.color = styles.remix.icon_Color_CopyToClipboard } |
|
|
|
@ -29,7 +29,7 @@ module.exports = function copyToClipboard (getContent) { |
|
|
|
|
} |
|
|
|
|
} catch (e) {} |
|
|
|
|
copy(copiableContent) |
|
|
|
|
addTooltip('Successfully copied!') |
|
|
|
|
addTooltip(tip) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return copyIcon |
|
|
|
|