@@ -19,6 +19,7 @@ define([
1919
2020 , VP_ID_APIBLOCK_MENU_BOX
2121 , VP_ID_APIBLOCK_MENU_RUN
22+ , VP_ID_APIBLOCK_MENU_ADD
2223 , VP_ID_APIBLOCK_MENU_DUPLICATE
2324 , VP_ID_APIBLOCK_MENU_DELETE
2425
@@ -51,6 +52,9 @@ define([
5152 // run button
5253 sbBlockMenu . appendFormatLine ( '<div id="{0}" class="{1}">{2}</div>'
5354 , VP_ID_APIBLOCK_MENU_RUN , VP_CLASS_APIBLOCK_MENU_ITEM , 'Run' ) ;
55+ // add button
56+ sbBlockMenu . appendFormatLine ( '<div id="{0}" class="{1}">{2}</div>'
57+ , VP_ID_APIBLOCK_MENU_ADD , VP_CLASS_APIBLOCK_MENU_ITEM , 'Add' ) ;
5458 // duplicate button
5559 sbBlockMenu . appendFormatLine ( '<div id="{0}" class="{1}">{2}</div>'
5660 , VP_ID_APIBLOCK_MENU_DUPLICATE , VP_CLASS_APIBLOCK_MENU_ITEM , 'Duplicate' ) ;
@@ -92,11 +96,16 @@ define([
9296 that . block . runThisBlock ( ) ;
9397 that . close ( ) ;
9498 } ) ;
99+ /** add block */
100+ $ ( document ) . off ( STR_CLICK , this . wrapSelector ( VP_ID_PREFIX + VP_ID_APIBLOCK_MENU_ADD ) ) ;
101+ $ ( document ) . on ( STR_CLICK , this . wrapSelector ( VP_ID_PREFIX + VP_ID_APIBLOCK_MENU_ADD ) , function ( ) {
102+ that . block . runThisBlock ( false ) ;
103+ that . close ( ) ;
104+ } ) ;
95105 /** duplicate block */
96106 $ ( document ) . off ( STR_CLICK , this . wrapSelector ( VP_ID_PREFIX + VP_ID_APIBLOCK_MENU_DUPLICATE ) ) ;
97107 $ ( document ) . on ( STR_CLICK , this . wrapSelector ( VP_ID_PREFIX + VP_ID_APIBLOCK_MENU_DUPLICATE ) , function ( ) {
98- // TODO: duplicate block
99-
108+ // duplicate block
100109 var blockContainer = that . block . getBlockContainerThis ( ) ;
101110
102111 // blockContainer.setCtrlSaveData();
0 commit comments