1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: Dev fix: Added back title on header buttons

This commit is contained in:
Laurent Cozic
2020-07-04 10:33:04 +01:00
parent 3aea55ee63
commit 7035b1f9f6
7 changed files with 18 additions and 2 deletions

View File

@ -52,13 +52,14 @@ export const runtime = (comp:any):CommandRuntime => {
}); });
}, },
title: (props:any):string => { title: (props:any):string => {
if (!props.noteId || !props.notes) return null;
const note = BaseModel.byId(props.notes, props.noteId); const note = BaseModel.byId(props.notes, props.noteId);
if (!note || !note.todo_due) return null; if (!note || !note.todo_due) return null;
return time.formatMsToLocal(note.todo_due); return time.formatMsToLocal(note.todo_due);
}, },
isEnabled: (props:any):boolean => { isEnabled: (props:any):boolean => {
const { notes, noteId } = props; const { notes, noteId } = props;
if (!noteId) return false; if (!noteId || !notes) return false;
const note = BaseModel.byId(notes, noteId); const note = BaseModel.byId(notes, noteId);
if (!note) return false; if (!note) return false;
return !!note.is_todo && !note.todo_completed; return !!note.is_todo && !note.todo_completed;

View File

@ -38,5 +38,8 @@ export const runtime = ():CommandRuntime => {
const { folders, selectedFolderId } = utils.store.getState(); const { folders, selectedFolderId } = utils.store.getState();
return !!folders.length && selectedFolderId !== Folder.conflictFolderId(); return !!folders.length && selectedFolderId !== Folder.conflictFolderId();
}, },
title: () => {
return _('New note');
},
}; };
}; };

View File

@ -45,5 +45,8 @@ export const runtime = (comp:any):CommandRuntime => {
notes: state.notes, notes: state.notes,
}; };
}, },
title: () => {
return _('New notebook');
},
}; };
}; };

View File

@ -15,5 +15,8 @@ export const runtime = ():CommandRuntime => {
isEnabled: () => { isEnabled: () => {
return CommandService.instance().isEnabled('newNote'); return CommandService.instance().isEnabled('newNote');
}, },
title: () => {
return _('New to-do');
},
}; };
}; };

View File

@ -14,5 +14,8 @@ export const runtime = (comp:any):CommandRuntime => {
type: 'NOTELIST_VISIBILITY_TOGGLE', type: 'NOTELIST_VISIBILITY_TOGGLE',
}); });
}, },
title: () => {
return _('Toggle note list');
},
}; };
}; };

View File

@ -14,5 +14,8 @@ export const runtime = (comp:any):CommandRuntime => {
type: 'SIDEBAR_VISIBILITY_TOGGLE', type: 'SIDEBAR_VISIBILITY_TOGGLE',
}); });
}, },
title: () => {
return _('Toggle sidebar');
},
}; };
}; };

View File

@ -232,7 +232,7 @@ export default class CommandService extends BaseService {
title(commandName:string):string { title(commandName:string):string {
const command = this.commandByName(commandName); const command = this.commandByName(commandName);
if (!command || !command.runtime) return null; if (!command || !command.runtime) return null;
return command.runtime.props ? command.runtime.title(command.runtime.props ? command.runtime.props : {}) : null; return command.runtime.title(command.runtime.props ? command.runtime.props : {});
} }
private extractExecuteArgs(command:Command, executeArgs:any) { private extractExecuteArgs(command:Command, executeArgs:any) {