fix(form_sidebar): copy document title
This commit is contained in:
parent
921e474867
commit
b4d87d6140
3 changed files with 6 additions and 3 deletions
|
|
@ -72,8 +72,10 @@ frappe.ui.form.Sidebar = class {
|
|||
}
|
||||
|
||||
setup_copy_event() {
|
||||
let classes = [".form-name-copy", ".form-title-text"];
|
||||
|
||||
$(this.sidebar)
|
||||
.find(".sidebar-meta-details .form-name-copy")
|
||||
.find(".sidebar-meta-details " + classes.join(", "))
|
||||
.tooltip()
|
||||
.on("click", (e) => {
|
||||
frappe.utils.copy_to_clipboard($(e.currentTarget).attr("data-copy"));
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@
|
|||
<div class="flex justify-between overflow-hidden">
|
||||
<div class="ellipsis">
|
||||
{% let title = frm.get_title(); %}
|
||||
<div class="form-details flex justify-between">
|
||||
<span class="bold ellipsis form-title-text mr-3 text-medium">{%= frappe.utils.escape_html(frappe.utils.html2text(title)) %}</span>
|
||||
<div class="form-details flex justify-between form-title-text" data-copy="{{title}}">
|
||||
<span class="bold ellipsis mr-3 text-medium">{%= frappe.utils.escape_html(frappe.utils.html2text(title)) %}</span>
|
||||
</div>
|
||||
{% if frm.meta.beta %}
|
||||
<div class="pt-1">
|
||||
|
|
|
|||
|
|
@ -224,6 +224,7 @@
|
|||
.form-title-text {
|
||||
// to match the actions button height for center alignment
|
||||
line-height: 28px;
|
||||
cursor: copy;
|
||||
}
|
||||
|
||||
.form-stats-likes {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue