@@ -360,28 +360,6 @@ function RemoteFunctions(config = {}) {
360360 } ) ;
361361 }
362362
363- /**
364- * this is for cut button, when user clicks on cut button we copy the element's source code
365- * into the clipboard and remove it from the src code. read `_cutElementToClipboard` in `LivePreviewEdit.js`
366- * @param {Event } event
367- * @param {DOMElement } element - the element we need to cut
368- */
369- function _handleCutOptionClick ( event , element ) {
370- if ( LivePreviewView . isElementEditable ( element ) ) {
371- const tagId = element . getAttribute ( GLOBALS . DATA_BRACKETS_ID_ATTR ) ;
372-
373- window . _Brackets_MessageBroker . send ( {
374- livePreviewEditEnabled : true ,
375- element : element ,
376- event : event ,
377- tagId : Number ( tagId ) ,
378- cut : true
379- } ) ;
380- } else {
381- console . error ( "The TagID might be unavailable or the element tag is directly body or html" ) ;
382- }
383- }
384-
385363 /**
386364 * this is for copy button, similar to cut just we don't remove the elements source code
387365 * @param {Event } event
@@ -434,8 +412,6 @@ function RemoteFunctions(config = {}) {
434412 function handleOptionClick ( e , action , element ) {
435413 if ( action === "edit-text" ) {
436414 startEditing ( element ) ;
437- } else if ( action === "cut" ) {
438- _handleCutOptionClick ( e , element ) ;
439415 } else if ( action === "copy" ) {
440416 _handleCopyOptionClick ( e , element ) ;
441417 } else if ( action === "paste" ) {
@@ -447,7 +423,7 @@ function RemoteFunctions(config = {}) {
447423 return true ;
448424 } else if ( LivePreviewView . getNodeMoreOptionsHandler ( action ) ) {
449425 const handler = LivePreviewView . getNodeMoreOptionsHandler ( action ) ;
450- return handler . handleClick ( e , element ) ;
426+ return handler && handler . handleClick && handler . handleClick ( e , element ) ;
451427 }
452428 }
453429
@@ -1055,10 +1031,6 @@ function RemoteFunctions(config = {}) {
10551031
10561032 let content = `
10571033 <div class="more-options-dropdown">
1058- <div class="dropdown-item" data-action="cut">
1059- <span class="item-icon">${ icons . cut } </span>
1060- <span class="item-label">${ strings . cut } </span>
1061- </div>
10621034 <div class="dropdown-item" data-action="copy">
10631035 <span class="item-icon">${ icons . copy } </span>
10641036 <span class="item-label">${ strings . copy } </span>
@@ -1067,7 +1039,6 @@ function RemoteFunctions(config = {}) {
10671039 <span class="item-icon">${ icons . paste } </span>
10681040 <span class="item-label">${ strings . paste } </span>
10691041 </div>
1070- <div class="dropdown-separator"></div>
10711042 ${ handlerItems }
10721043 </div>
10731044 ` ;
@@ -1102,14 +1073,9 @@ function RemoteFunctions(config = {}) {
11021073
11031074 // Check if any handler wants to handle this dropdown action
11041075 let handlerHandledIt = false ;
1105- for ( const handler of getAllNodeMoreOptionsHandlers ( ) ) {
1106- if ( handler . handleDropdownClick ) {
1107- const handled = handler . handleDropdownClick ( action , this ) ;
1108- if ( handled ) {
1109- handlerHandledIt = true ;
1110- break ; // Handler handled it, keep dropdown open
1111- }
1112- }
1076+ const handler = LivePreviewView . getNodeMoreOptionsHandler ( action ) ;
1077+ if ( handler && handler . handleDropdownClick ) {
1078+ handlerHandledIt = handler . handleDropdownClick ( event , this . targetElement , this ) ;
11131079 }
11141080
11151081 if ( ! handlerHandledIt ) {
0 commit comments