File tree 1 file changed +11
-1
lines changed 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ define([
70
70
'display: none; position: fixed;' ) ;
71
71
// edit button
72
72
sbBlockMenu . appendLine ( '<div id="vp_block_menu_edit" class="vp-block-menu-item">Edit</div>' ) ;
73
- sbBlockMenu . appendLine ( '<hr class="vp-extra-menu-line">' ) ;
73
+ sbBlockMenu . appendLine ( '<hr class="vp-extra-menu-line" id="vp_block_menu_line_1" >' ) ;
74
74
// run button
75
75
sbBlockMenu . appendLine ( '<div id="vp_block_menu_run" class="vp-block-menu-item">Run</div>' ) ;
76
76
// add button
@@ -91,11 +91,21 @@ define([
91
91
} ;
92
92
93
93
$ ( this . wrapSelector ( ) ) . css ( this . position ) ;
94
+ // show items
95
+ $ ( this . wrapSelector ( '.vp-block-menu-item' ) ) . show ( ) ;
96
+ $ ( this . wrapSelector ( '.vp-extra-menu-line' ) ) . show ( ) ;
94
97
$ ( this . wrapSelector ( ) ) . show ( ) ;
98
+
95
99
// filter menu depends on block
100
+ let noContentBlocks = [ 'lgCtrl_try' , 'lgCtrl_else' , 'lgCtrl_finally' ] ;
96
101
if ( this . block . isSubBlock ) {
97
102
// no duplicate
98
103
$ ( this . wrapSelector ( '#vp_block_menu_duplicate' ) ) . hide ( ) ;
104
+ }
105
+ if ( noContentBlocks . includes ( this . block . id ) ) {
106
+ // no edit mode
107
+ $ ( this . wrapSelector ( '#vp_block_menu_edit' ) ) . hide ( ) ;
108
+ $ ( this . wrapSelector ( '#vp_block_menu_line_1' ) ) . hide ( ) ;
99
109
}
100
110
}
101
111
You can’t perform that action at this time.
0 commit comments