Skip to content

Commit 0aa1273

Browse files
committed
Address feedback from go-gitea#22517
- use octicons for icon - use fomantic for centering the link
1 parent eb793c3 commit 0aa1273

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

web_src/js/features/common-global.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {showGlobalErrorMessage} from '../bootstrap.js';
77
import {attachDropdownAria} from './aria.js';
88
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js';
99
import {initTooltip} from '../modules/tippy.js';
10+
import {svg} from '../svg.js';
1011

1112
const {appUrl, csrfToken} = window.config;
1213

@@ -169,10 +170,10 @@ export function initGlobalDropzone() {
169170
$dropzone.find('.files').append(input);
170171
// Create a "Copy Link" element, to conveniently copy the image
171172
// or file link as Markdown to the clipboard
172-
const copyLinkElement = document.createElement('a');
173-
copyLinkElement.className = 'dz-remove';
174-
copyLinkElement.href = '#';
175-
copyLinkElement.innerHTML = '<i class="fa fa-copy"></i> Copy link';
173+
const copyLinkElement = document.createElement('div');
174+
copyLinkElement.className = 'tc';
175+
// The a element has a hardcoded cursor: pointer because the default is overridden by .dropzone
176+
copyLinkElement.innerHTML = `<a href="#" style="cursor: pointer;">${svg('octicon-copy', 14, 'copy link')} Copy link</a>`;
176177
copyLinkElement.addEventListener('click', (e) => {
177178
e.preventDefault();
178179
let fileMarkdown = `[${file.name}](/attachments/${file.uuid})`;

0 commit comments

Comments
 (0)