Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/common/vpFrameEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,20 +1131,22 @@ define([
return code.toString();
}

FrameEditor.prototype.apply = function(runCell = true) {
FrameEditor.prototype.apply = function(addCell=false, runCell=false) {
var code = this.generateCode();
if (this.pageThis) {
$(this.pageThis.wrapSelector('#' + this.targetId)).val(code);
$(this.pageThis.wrapSelector('#' + this.targetId)).trigger({
type: 'frame_run',
code: code,
addCell: addCell,
runCell: runCell
});
} else {
$(vpCommon.wrapSelector('#' + this.targetId)).val(code);
$(vpCommon.wrapSelector('#' + this.targetId)).trigger({
type: 'frame_run',
code: code,
addCell: addCell,
runCell: runCell
});
}
Expand Down Expand Up @@ -1551,7 +1553,7 @@ define([

// click run
$(document).on('click', this.wrapSelector('.' + VP_FE_BUTTON_RUN), function() {
that.apply();
that.apply(true, true);
that.close();
});

Expand All @@ -1561,11 +1563,14 @@ define([
$(that.wrapSelector('.' + VP_FE_DETAIL_BOX)).show();
});

// click add
// click add / apply
$(document).on('click', this.wrapSelector('.' + VP_FE_DETAIL_ITEM), function() {
var type = $(this).data('type');
if (type == 'add') {
that.apply(false);
that.apply(true);
that.close();
} else if (type == 'apply') {
that.apply();
that.close();
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/common/vpPopupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ define([

// click run
$(document).on('click', this.wrapSelector('.' + VP_PP_BUTTON_RUN), function() {
that.apply();
that.apply(true, true);
that.close();
});

Expand Down