mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 21:08:03 +08:00
FIX: Improve admin permalink UX (#10101)
The admin permalink list was a little tricky to use because the URLs are easily reduced with a ... if they are too long. This adds a copy to clipboard button for the URL and a title on hover so the full text of the URL can be seen.
This commit is contained in:
@ -22,6 +22,16 @@ export default Controller.extend({
|
||||
this.model.unshiftObject(arg);
|
||||
},
|
||||
|
||||
copyUrl(pl) {
|
||||
let linkElement = document.querySelector(`#admin-permalink-${pl.id}`);
|
||||
let textArea = document.createElement("textarea");
|
||||
textArea.value = linkElement.textContent;
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
document.execCommand("Copy");
|
||||
textArea.remove();
|
||||
},
|
||||
|
||||
destroy: function(record) {
|
||||
return bootbox.confirm(
|
||||
I18n.t("admin.permalink.delete_confirm"),
|
||||
|
Reference in New Issue
Block a user