clipboardSuccess

This commit is contained in:
Szekeres Bálint
2018-01-20 22:01:08 +01:00
parent c8cd5a1c8f
commit 765936b5d7
3 changed files with 23 additions and 0 deletions

View File

@@ -102,6 +102,12 @@ main .file .btn-clipboard {
vertical-align: text-bottom;
}
main .file .clipboard-success {
font-size: 0.8rem;
color: #4BB543;
font-weight: 700;
}
main .file .code,
main .commands {
padding: 0.5rem;

View File

@@ -59,6 +59,7 @@
$scope.gzipTypes = 'text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml';
$scope.clipboardCopy = undefined;
/////////////////////
@@ -114,6 +115,14 @@
};
$scope.clipboardSuccess = function(key) {
$scope.clipboardCopy = key;
$timeout(function(_key) {
if ($scope.clipboardCopy === _key) {
$scope.clipboardCopy = undefined;
}
}, 1500, true, key);
gtag('event', key, {
event_category: 'clipboard',
});