Skip to content

Commit 369ab2b

Browse files
author
minjk-bl
committed
Fix bug on Frame app
1 parent 7060024 commit 369ab2b

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

js/m_apps/Frame.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,13 @@ define([
107107
that.state.originObj = origin;
108108
that.state.tempObj = '_vp';
109109
that.state.returnObj = that.state.tempObj;
110-
that.state.inplace = false;
110+
if (that.state.inplace === true) {
111+
that.state.returnObj = origin;
112+
}
111113
that.initState();
112114

113115
// 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);
116117

117118
// reset table
118119
$(that.wrapSelector('.' + VP_FE_TABLE)).replaceWith(function() {
@@ -514,14 +515,15 @@ define([
514515
super.render();
515516

516517
var {
518+
originObj,
517519
returnObj,
518520
inplace,
519521
steps
520522
} = this.state;
521523

522524
this.loadVariableList();
523525

524-
$(this.wrapSelector('#vp_feVariable')).val(this.state.originObj);
526+
$(this.wrapSelector('#vp_feVariable')).val(originObj);
525527

526528
$(this.wrapSelector('#vp_feReturn')).val(returnObj);
527529

@@ -1485,7 +1487,11 @@ define([
14851487
that.loadInfo();
14861488
// add to stack
14871489
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+
]
14891495
var replacedCode = codeStr.replaceAll(that.state.tempObj, that.state.returnObj);
14901496
that.setPreview(replacedCode);
14911497
}
@@ -1509,7 +1515,10 @@ define([
15091515
}).catch(function(resultObj) {
15101516
let { result, type, msg } = resultObj;
15111517
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+
}
15131522
that.loading = false;
15141523
});
15151524

0 commit comments

Comments
 (0)