@@ -107,12 +107,13 @@ define([
107
107
that . state . originObj = origin ;
108
108
that . state . tempObj = '_vp' ;
109
109
that . state . returnObj = that . state . tempObj ;
110
- that . state . inplace = false ;
110
+ if ( that . state . inplace === true ) {
111
+ that . state . returnObj = origin ;
112
+ }
111
113
that . initState ( ) ;
112
114
113
115
// reset return obj
114
- $ ( that . wrapSelector ( '#vp_feReturn' ) ) . val ( that . state . tempObj ) ;
115
- $ ( that . wrapSelector ( '#inplace' ) ) . prop ( 'checked' , false ) ;
116
+ $ ( that . wrapSelector ( '#vp_feReturn' ) ) . val ( that . state . returnObj ) ;
116
117
117
118
// reset table
118
119
$ ( that . wrapSelector ( '.' + VP_FE_TABLE ) ) . replaceWith ( function ( ) {
@@ -514,14 +515,15 @@ define([
514
515
super . render ( ) ;
515
516
516
517
var {
518
+ originObj,
517
519
returnObj,
518
520
inplace,
519
521
steps
520
522
} = this . state ;
521
523
522
524
this . loadVariableList ( ) ;
523
525
524
- $ ( this . wrapSelector ( '#vp_feVariable' ) ) . val ( this . state . originObj ) ;
526
+ $ ( this . wrapSelector ( '#vp_feVariable' ) ) . val ( originObj ) ;
525
527
526
528
$ ( this . wrapSelector ( '#vp_feReturn' ) ) . val ( returnObj ) ;
527
529
@@ -1485,7 +1487,11 @@ define([
1485
1487
that . loadInfo ( ) ;
1486
1488
// add to stack
1487
1489
if ( codeStr !== '' ) {
1488
- that . state . steps . push ( codeStr ) ;
1490
+ let newSteps = codeStr . split ( '\n' ) ;
1491
+ that . state . steps = [
1492
+ ...that . state . steps ,
1493
+ ...newSteps
1494
+ ]
1489
1495
var replacedCode = codeStr . replaceAll ( that . state . tempObj , that . state . returnObj ) ;
1490
1496
that . setPreview ( replacedCode ) ;
1491
1497
}
@@ -1509,7 +1515,10 @@ define([
1509
1515
} ) . catch ( function ( resultObj ) {
1510
1516
let { result, type, msg } = resultObj ;
1511
1517
vpLog . display ( VP_LOG_TYPE . ERROR , result . ename + ': ' + result . evalue , msg , code . toString ( ) ) ;
1512
- com_util . renderAlertModal ( result . ename + ': ' + result . evalue ) ;
1518
+ if ( that . isHidden ( ) == false ) {
1519
+ // show alert modal only if this popup is visible
1520
+ com_util . renderAlertModal ( result . ename + ': ' + result . evalue ) ;
1521
+ }
1513
1522
that . loading = false ;
1514
1523
} ) ;
1515
1524
0 commit comments