feat: enhance sidebar edit functionality and prevent text selection
- Added aria-label and type attributes to the edit button in the sidebar. - Implemented a mechanism to prevent multiple edit triggers using requestAnimationFrame. - Updated mousedown event handling to allow real controls while preventing text selection in WKWebView. feat: add reconnectSession method to TabManager - Introduced reconnectSession method to facilitate session reconnections by ID. feat: implement disconnected overlay in terminal - Added setDisconnectedOverlay method to show/hide a disconnected overlay for terminal sessions. - Created _ensureDisconnectOverlay method to manage the overlay's existence and content. feat: extend Service API with file-related functions - Added FileExists and FileIsPrivateKey functions to check file existence and identify private keys. - Introduced ListSSHKeys function to retrieve SSH private key paths from the user's .ssh directory. - Implemented SFTPStat and SFTPUploadData functions for enhanced SFTP operations. refactor: clean up code formatting and improve readability - Adjusted code formatting for better readability across various files, including consistent use of line breaks and indentation.
This commit is contained in:
@@ -253,11 +253,22 @@
|
||||
const editBtn = createElement("button", "sidebar-item-edit", {
|
||||
textContent: "✎",
|
||||
title: "Edit profile",
|
||||
type: "button",
|
||||
"aria-label": "Edit profile",
|
||||
});
|
||||
editBtn.addEventListener("click", (e) => {
|
||||
let editTriggered = false;
|
||||
const triggerEdit = (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (editTriggered) return;
|
||||
editTriggered = true;
|
||||
requestAnimationFrame(() => {
|
||||
editTriggered = false;
|
||||
});
|
||||
this.app.profileEditor.openEdit(profile.id);
|
||||
});
|
||||
};
|
||||
editBtn.addEventListener("mousedown", triggerEdit);
|
||||
editBtn.addEventListener("click", triggerEdit);
|
||||
item.appendChild(editBtn);
|
||||
|
||||
// Favourite star
|
||||
@@ -268,8 +279,11 @@
|
||||
item.appendChild(star);
|
||||
}
|
||||
|
||||
// Prevent mousedown text selection in WKWebView
|
||||
item.addEventListener("mousedown", (e) => e.preventDefault());
|
||||
// Prevent mousedown text selection in WKWebView, but allow real controls.
|
||||
item.addEventListener("mousedown", (e) => {
|
||||
if (e.target.closest("button, input, select, textarea")) return;
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Click → connect / multi-select
|
||||
item.addEventListener("click", (e) => {
|
||||
|
||||
Reference in New Issue
Block a user