File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1131,20 +1131,22 @@ define([
1131
1131
return code . toString ( ) ;
1132
1132
}
1133
1133
1134
- FrameEditor . prototype . apply = function ( runCell = true ) {
1134
+ FrameEditor . prototype . apply = function ( addCell = false , runCell = false ) {
1135
1135
var code = this . generateCode ( ) ;
1136
1136
if ( this . pageThis ) {
1137
1137
$ ( this . pageThis . wrapSelector ( '#' + this . targetId ) ) . val ( code ) ;
1138
1138
$ ( this . pageThis . wrapSelector ( '#' + this . targetId ) ) . trigger ( {
1139
1139
type : 'frame_run' ,
1140
1140
code : code ,
1141
+ addCell : addCell ,
1141
1142
runCell : runCell
1142
1143
} ) ;
1143
1144
} else {
1144
1145
$ ( vpCommon . wrapSelector ( '#' + this . targetId ) ) . val ( code ) ;
1145
1146
$ ( vpCommon . wrapSelector ( '#' + this . targetId ) ) . trigger ( {
1146
1147
type : 'frame_run' ,
1147
1148
code : code ,
1149
+ addCell : addCell ,
1148
1150
runCell : runCell
1149
1151
} ) ;
1150
1152
}
@@ -1551,7 +1553,7 @@ define([
1551
1553
1552
1554
// click run
1553
1555
$ ( document ) . on ( 'click' , this . wrapSelector ( '.' + VP_FE_BUTTON_RUN ) , function ( ) {
1554
- that . apply ( ) ;
1556
+ that . apply ( true , true ) ;
1555
1557
that . close ( ) ;
1556
1558
} ) ;
1557
1559
@@ -1561,11 +1563,14 @@ define([
1561
1563
$ ( that . wrapSelector ( '.' + VP_FE_DETAIL_BOX ) ) . show ( ) ;
1562
1564
} ) ;
1563
1565
1564
- // click add
1566
+ // click add / apply
1565
1567
$ ( document ) . on ( 'click' , this . wrapSelector ( '.' + VP_FE_DETAIL_ITEM ) , function ( ) {
1566
1568
var type = $ ( this ) . data ( 'type' ) ;
1567
1569
if ( type == 'add' ) {
1568
- that . apply ( false ) ;
1570
+ that . apply ( true ) ;
1571
+ that . close ( ) ;
1572
+ } else if ( type == 'apply' ) {
1573
+ that . apply ( ) ;
1569
1574
that . close ( ) ;
1570
1575
}
1571
1576
} ) ;
Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ define([
216
216
217
217
// click run
218
218
$ ( document ) . on ( 'click' , this . wrapSelector ( '.' + VP_PP_BUTTON_RUN ) , function ( ) {
219
- that . apply ( ) ;
219
+ that . apply ( true , true ) ;
220
220
that . close ( ) ;
221
221
} ) ;
222
222
You can’t perform that action at this time.
0 commit comments