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:
Martin Brennan
2020-06-22 13:14:16 +10:00
committed by GitHub
parent 26260d50b1
commit 516a03be09
5 changed files with 16 additions and 4 deletions

View File

@ -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"),