fix: make the desktop editing easy to discover

This commit is contained in:
sokumon 2025-12-30 14:49:02 +05:30
parent e6f867da74
commit 328ddc1949
3 changed files with 30 additions and 1 deletions

View file

@ -437,3 +437,18 @@
}
}
}
.desktop-edit{
width: 36px;
height: 36px;
background-color: var(--surface-gray-7);
position: absolute;
bottom: 4%;
right: 4%;
z-index: 100;
opacity: 0.1;
}
.desktop-edit:hover{
opacity: 1;
transition: opacity 0.3s;
}

View file

@ -36,5 +36,5 @@
<button class="save btn btn-primary ellipsis">
{{ _("Save") }}
</button>
</div>`
</div>
</div>

View file

@ -179,6 +179,20 @@ class DesktopPage {
this.setup_editing_mode();
this.handle_route_change();
this.setup_events();
this.setup_edit_button();
}
setup_edit_button() {
const me = this;
this.$desktop_edit_button = $(
"<button class='btn btn-reset desktop-edit'></button>"
).appendTo(document.body);
this.$desktop_edit_button.html(
frappe.utils.icon("square-pen", "md", "", "", "", "", "white")
);
this.$desktop_edit_button.on("click", () => {
me.start_editing_layout();
me.$desktop_edit_button.hide();
});
}
setup_editing_mode() {
const me = this;