Merge pull request #36309 from sokumon/desktop-editing-fixes

This commit is contained in:
Soham Kulkarni 2026-01-26 21:39:29 +05:30 committed by GitHub
commit cf1b1a73e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 50 additions and 7 deletions

View file

@ -144,7 +144,7 @@
}
],
"links": [],
"modified": "2026-01-23 14:33:55.594120",
"modified": "2026-01-25 15:29:33.884930",
"modified_by": "Administrator",
"module": "Desk",
"name": "Desktop Icon",
@ -162,6 +162,18 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Desk User",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View file

@ -27,7 +27,7 @@
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2026-01-18 02:45:37.287424",
"modified": "2026-01-25 15:30:12.805037",
"modified_by": "Administrator",
"module": "Desk",
"name": "Desktop Layout",
@ -45,6 +45,18 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Desk User",
"share": 1,
"write": 1
}
],
"row_format": "Dynamic",

View file

@ -183,6 +183,7 @@
& .modal-content {
top: 120px;
border-radius: var(--desktop-modal-radius);
align-items: center;
}
}
}
@ -196,10 +197,13 @@
width: var(--desktop-modal-width);
height: var(--desktop-modal-height);
padding: 24px 23px !important;
width: fit-content;
& .icons{
gap: 0px 0px;
}
& .icons:has(.desktop-edit-mode){
margin-top: 4px;
gap: 6px 6px;
}
.icon-container{
min-height: var(--desktop-icon-dimension);
}

View file

@ -129,8 +129,9 @@ function save_desktop(icons) {
}
function reset_to_default() {
frappe.model.user_settings.save("Desktop Icon", "icons_to_create", null);
frappe.model.user_settings.save("Desktop Icon", "desktop_layout", null);
frappe.db.delete_doc("Desktop Layout", frappe.session.user).then(() => {
frappe.ui.toolbar.clear_cache();
});
}
function toggle_icons(icons) {
@ -1061,6 +1062,10 @@ class DesktopModal {
setup(icon_title, child_icons_data, grid_row_size) {
const me = this;
this.make_modal(icon_title);
// Check if we're in edit mode
const is_edit_mode = frappe.pages["desktop"].desktop_page.edit_mode;
this.child_icon_grid = new DesktopIconGrid({
wrapper: this.$child_icons_wrapper,
icons_data: child_icons_data,
@ -1068,8 +1073,16 @@ class DesktopModal {
in_folder: false,
in_modal: true,
parent_icon: this.parent_icon_obj,
edit_mode: is_edit_mode, // Pass edit mode state
});
// If in edit mode, setup reordering for the modal icons
if (is_edit_mode) {
this.child_icon_grid.grids.forEach((grid) => {
this.child_icon_grid.setup_reordering(grid);
});
}
this.modal.on("hidden.bs.modal", function () {
me.modal.remove();
frappe.desktop_utils.modal = null;
@ -1187,8 +1200,10 @@ class InlineEditor {
bindEvents() {
this.container.on("click", () => {
this.label.css("visibility", "hidden");
this.input.focus().select();
if (frappe.pages["desktop"].desktop_page.edit_mode) {
this.label.css("visibility", "hidden");
this.input.focus().select();
}
});
this.input.on("keydown", (event) => {