prepending * to menutitle if custom prompt needed
This commit is contained in:
parent
4b630bee78
commit
c61268f1f2
1 changed files with 13 additions and 2 deletions
|
|
@ -118,7 +118,7 @@ export class mzta_Menus {
|
|||
|
||||
browser.menus.create({
|
||||
id: id,
|
||||
title: browser.i18n.getMessage(id),
|
||||
title: this.getCustomTextAttribute(id) + browser.i18n.getMessage(id),
|
||||
contexts: this.getContexts(id),
|
||||
parentId: root
|
||||
});
|
||||
|
|
@ -151,6 +151,17 @@ export class mzta_Menus {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
getCustomTextAttribute(id){
|
||||
const curr_prompt = defaultPrompts.find(p => p.id === id);
|
||||
if (!curr_prompt) {
|
||||
return "";
|
||||
}
|
||||
if(curr_prompt.need_custom_text === 1){
|
||||
return "*";
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue