Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd5595b

Browse files
author
minjk-bl
committed
Edit to save last action as a default run type
1 parentc16cb89 commitbd5595b

File tree

2 files changed

+25
-45
lines changed

2 files changed

+25
-45
lines changed

‎visualpython/css/component/popupComponent.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@
525525
height:25px;
526526
}
527527
.vp-popup-frame .vp-accordian-box {
528-
padding:0px15px15px0px;
528+
padding:0px15px0px0px;
529529
}
530530

531531
/* resizable handler */

‎visualpython/js/com/component/PopupComponent.js‎

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -487,22 +487,7 @@ define([
487487
// set run button
488488
vpConfig.getData('runType','vpcfg').then(function(data){
489489
vpLog.display(VP_LOG_TYPE.DEVELOP,'Runtype get data',data);
490-
if(data==undefined||data==null||data===''){
491-
data='run';// default = run
492-
}
493-
that.config.runType=data;
494-
$(that.wrapSelector(`.vp-popup-run-type[value="${data}"]`)).prop('checked',true);
495-
$(that.wrapSelector('.vp-popup-run-button')).attr('data-type',data);
496-
letrunTitle='Run code';
497-
switch(data){
498-
case'run-save':
499-
runTitle='Save to block & Run code';
500-
break;
501-
case'add':
502-
runTitle='Add code to cell';
503-
break;
504-
}
505-
$(that.wrapSelector('.vp-popup-run-button')).prop('title',runTitle);
490+
that._setDefaultRunType(data);
506491
});
507492
evt.stopPropagation();
508493
break;
@@ -527,24 +512,15 @@ define([
527512
// Click detail radio
528513
$(this.wrapSelector('.vp-popup-run-type')).on('click',function(evt){
529514
letrunType=$(that.wrapSelector('.vp-popup-run-type[name=runType]:checked')).val();
530-
that.config.runType=runType;
531515
// save as vpConfig
532516
vpConfig.setData({runType:runType},'vpcfg');
533-
$(that.wrapSelector('.vp-popup-run-button')).attr('data-type',runType);
534-
letrunTitle='Run code';
535-
switch(runType){
536-
case'run-save':
537-
runTitle='Save to block & Run code';
538-
break;
539-
case'add':
540-
runTitle='Add code to cell';
541-
break;
542-
}
543-
$(that.wrapSelector('.vp-popup-run-button')).prop('title',runTitle);
517+
that._setDefaultRunType(runType);
544518
});
545519
// Click detail buttons
546520
$(this.wrapSelector('.vp-popup-detail-action-button')).on('click',function(evt){
547521
varbtnType=$(this).data('type');
522+
vpConfig.setData({runType:runType},'vpcfg');
523+
that._setDefaultRunType(btnType);// run, run-save, add
548524
switch(btnType){
549525
// case 'apply':
550526
// that.save();
@@ -749,22 +725,7 @@ define([
749725
letthat=this;
750726
vpConfig.getData('runType','vpcfg').then(function(data){
751727
vpLog.display(VP_LOG_TYPE.DEVELOP,'Runtype get data',data);
752-
if(data==undefined||data==null||data===''){
753-
data='run';// default = run
754-
}
755-
that.config.runType=data;
756-
$(that.wrapSelector(`.vp-popup-run-type[value="${data}"]`)).prop('checked',true);
757-
$(that.wrapSelector('.vp-popup-run-button')).attr('data-type',data);
758-
letrunTitle='Run code';
759-
switch(data){
760-
case'run-save':
761-
runTitle='Save to block & Run code';
762-
break;
763-
case'add':
764-
runTitle='Add code to cell';
765-
break;
766-
}
767-
$(that.wrapSelector('.vp-popup-run-button')).prop('title',runTitle);
728+
that._setDefaultRunType(data);
768729
});
769730
}
770731

@@ -911,6 +872,25 @@ define([
911872
vpLog.display(VP_LOG_TYPE.DEVELOP,'savedState',that.state);
912873
}
913874

875+
_setDefaultRunType(runType){
876+
if(runType==undefined||runType==null||runType===''){
877+
runType='run';// default = run
878+
}
879+
this.config.runType=runType;
880+
$(this.wrapSelector(`.vp-popup-run-type[value="${runType}"]`)).prop('checked',true);
881+
$(this.wrapSelector('.vp-popup-run-button')).attr('data-type',runType);
882+
letrunTitle='Run code';// when runType is 'run'
883+
switch(runType){
884+
case'run-save':
885+
runTitle='Save to block & Run code';
886+
break;
887+
case'add':
888+
runTitle='Add code to cell';
889+
break;
890+
}
891+
$(this.wrapSelector('.vp-popup-run-button')).prop('title',runTitle);
892+
}
893+
914894
_getTagValue(tag){
915895
letid=tag.id;
916896
lettagName=$(tag).prop('tagName');// returns with UpperCase

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp