Skip to content

Commit 1ce8e78

Browse files
author
Amro Khalil
committed
Remove unused _shouldShowEditTextOption function
Deleted the _shouldShowEditTextOption function from RemoteFunctions.js as it is no longer used. This helps clean up the code and improve maintainability.
1 parent f5a2227 commit 1ce8e78

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -434,35 +434,8 @@ function RemoteFunctions(config) {
434434
delete window._currentDraggedElement;
435435
}
436436

437-
/**
438-
* this function is to check if an element should show the edit text option
439-
* it is needed because edit text option doesn't make sense with many elements like images, videos, hr tag etc
440-
* @param {Element} element - DOM element to check
441-
* @returns {boolean} - true if we should show the edit text option otherwise false
442-
*/
443-
function _shouldShowEditTextOption(element) {
444-
if (!element || !element.tagName) {
445-
return false;
446-
}
447-
448-
const tagName = element.tagName.toLowerCase();
449-
450-
// these are self-closing tags and don't allow any text content
451-
const voidElements = [
452-
"img",
453-
"br",
454-
"hr",
455-
"input",
456-
"meta",
457-
"link",
458-
"area",
459-
"base",
460-
"col",
461-
"embed",
462-
"source",
463-
"track",
464-
"wbr"
465-
];
437+
// calc estimate width based on the char count
438+
const infoBoxWidth = basePadding + (charCount * avgCharWidth);
466439

467440
// these elements are non-editable as they have their own mechanisms
468441
const nonEditableElements = [

0 commit comments

Comments
 (0)