feat(minor): show fieldname on hover in non-dev mode when cmd/ctrl is pressed
This commit is contained in:
parent
57c2d23422
commit
5b75ac9d22
1 changed files with 12 additions and 0 deletions
|
|
@ -6,6 +6,18 @@ frappe.ui.form.Control = class BaseControl {
|
|||
// if developer_mode=1, show fieldname as tooltip
|
||||
if (frappe.boot.user && frappe.boot.developer_mode === 1 && this.$wrapper) {
|
||||
this.$wrapper.attr("title", __(this.df.fieldname));
|
||||
} else if (this.$wrapper) {
|
||||
// show fieldname as tooltip when cmd/ctrl key is pressed
|
||||
$(document).on("keydown", (e) => {
|
||||
if (e.metaKey) {
|
||||
this.$wrapper.attr("title", __(this.df.fieldname));
|
||||
}
|
||||
});
|
||||
$(document).on("keyup", (e) => {
|
||||
if (!e.metaKey) {
|
||||
this.$wrapper.removeAttr("title");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (this.render_input) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue