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

Commitff99abe

Browse files
author
minjk-bl
committed
Edit menu search box to show its category and Popup to show its category on the title
1 parent060dc44 commitff99abe

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

‎visualpython/js/MainFrame.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,10 @@ define([
478478
letparentBlock=null;
479479
letprevBlock=null;
480480
loadStateList.forEach(obj=>{
481-
let{ blockType, menuId, menuState, menuConfig, argIdx, position, afterAction}=obj;
481+
let{file,blockType, menuId, menuState, menuConfig, argIdx, position, afterAction}=obj;
482482
// get OptionComponent Object
483483
// LAB: relative path needed
484-
letOptionComponent=require('./'+menuConfig.file);
484+
letOptionComponent=require('./'+file);
485485
if(OptionComponent){
486486
lettaskState=menuState.taskState;
487487
letblockState=menuState.blockState;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ define([
9292
this.id=this.state.config.id;
9393
this.name=this.state.config.name;
9494
this.path=this.state.config.path;
95+
this.category=this.state.config.category;
9596

9697

9798
this.config={
@@ -530,7 +531,8 @@ define([
530531
template(){
531532
this.$pageDom=$(popupComponentHtml.replaceAll('${vp_base}',com_Const.BASE_PATH));
532533
// set title
533-
this.$pageDom.find('.vp-popup-title').text(this.name);
534+
// this.$pageDom.find('.vp-popup-title').text(this.category + ' > ' + this.name);
535+
this.$pageDom.find('.vp-popup-title').html(`<span style="color: var(--gray-color);font-size: 12px;">${this.category} > </span><span>${this.name}</span>`);
534536
// set body
535537
letbodyTemplate=this.templateForBody();
536538
// CHROME: check url keyword and replace it

‎visualpython/js/menu/MenuFrame.js‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,19 @@ define([
199199
return{};
200200
}
201201

202-
getMenuLibrary(menuId,libraries=this.menuLibraries){
202+
getMenuLibrary(menuId,libraries=this.menuLibrariesFlatten){
203203
for(vari=0;i<libraries.length;i++){
204204
varitem=libraries[i];
205205
if(item){
206206
if(item.id===menuId){
207207
returnitem;
208208
}
209-
if(item.type==='package'){
210-
varresult=this.getMenuLibrary(menuId,item.item);
211-
if(result){
212-
returnresult;
213-
}
214-
}
209+
//if (item.type === 'package') {
210+
// var result = this.getMenuLibrary(menuId, item.item);
211+
// if (result) {
212+
// return result;
213+
// }
214+
//}
215215
}
216216
}
217217
returnnull;
@@ -243,7 +243,12 @@ define([
243243
varthat=this;
244244
varbody=group.getBody();
245245
varitem=group.getItem();
246+
varstate=group.getState();
246247
item&&item.forEach(child=>{
248+
// remember parent to navigate its parent menu
249+
varcategory=state.category?(state.category+' > '+state.name):state.name;
250+
child['category']=category;
251+
247252
if(child.type=='package'){
248253
// packages : MenuGroup
249254
varmenuGroup=newMenuGroup($(body),child);
@@ -289,7 +294,7 @@ define([
289294
});
290295

291296
letfunctionList=this.menuLibrariesFlatten.map(menu=>{
292-
return{label:menu.name,value:menu.name, ...menu}
297+
return{label:menu.name,value:menu.name,dtype:menu.category,...menu}
293298
});
294299
// render searchbox
295300
letsearchBox=newSuggestInput();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp