@@ -106,7 +106,7 @@ function RemoteFunctions(config = {}) {
106106
107107 const _moreOptionsHandlers = new Map ( ) ;
108108 function registerNodeMoreOptionsHandler ( handlerName , handler ) {
109- if ( _moreOptionsHandlers [ handlerName ] ) {
109+ if ( _moreOptionsHandlers . get ( handlerName ) ) {
110110 console . error ( `lp: More options handler '${ handlerName } ' already registered. Ignoring new registration` ) ;
111111 return ;
112112 }
@@ -358,28 +358,6 @@ function RemoteFunctions(config = {}) {
358358 } ) ;
359359 }
360360
361- /**
362- * This function gets called when the delete button is clicked
363- * it sends a message to the editor using postMessage to delete the element from the source code
364- * @param {Event } event
365- * @param {DOMElement } element - the HTML DOM element that was clicked.
366- */
367- function _handleDeleteOptionClick ( event , element ) {
368- if ( LivePreviewView . isElementEditable ( element ) ) {
369- const tagId = element . getAttribute ( GLOBALS . DATA_BRACKETS_ID_ATTR ) ;
370-
371- window . _Brackets_MessageBroker . send ( {
372- livePreviewEditEnabled : true ,
373- element : element ,
374- event : event ,
375- tagId : Number ( tagId ) ,
376- delete : true
377- } ) ;
378- } else {
379- console . error ( "The TagID might be unavailable or the element tag is directly body or html" ) ;
380- }
381- }
382-
383361 /**
384362 * this is for cut button, when user clicks on cut button we copy the element's source code
385363 * into the clipboard and remove it from the src code. read `_cutElementToClipboard` in `LivePreviewEdit.js`
@@ -482,8 +460,6 @@ function RemoteFunctions(config = {}) {
482460 _handleSelectParentOptionClick ( e , element ) ;
483461 } else if ( action === "edit-text" ) {
484462 startEditing ( element ) ;
485- } else if ( action === "delete" ) {
486- _handleDeleteOptionClick ( e , element ) ;
487463 } else if ( action === "cut" ) {
488464 _handleCutOptionClick ( e , element ) ;
489465 } else if ( action === "copy" ) {
@@ -939,11 +915,8 @@ function RemoteFunctions(config = {}) {
939915 </span>` ;
940916 }
941917
942- // Always include delete options
918+ // Always include more option ellipses at the end
943919 content += `
944- <span data-action="delete" title="${ strings . delete } ">
945- ${ icons . trash }
946- </span>
947920 <span data-action="more-options" title="${ strings . moreOptions } ">
948921 ${ icons . verticalEllipsis }
949922 </span>
0 commit comments