mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
disable property widgets if not applicable
This commit is contained in:
parent
6068bd7c44
commit
17073096cf
@ -57,9 +57,13 @@ const TPL = `
|
||||
export default class FilePropertiesWidget extends TabAwareWidget {
|
||||
static getType() { return "file"; }
|
||||
|
||||
isEnabled() {
|
||||
return this.note && this.note.type === 'file';
|
||||
}
|
||||
|
||||
renderTitle(note) {
|
||||
return {
|
||||
show: note.type === 'file',
|
||||
show: this.isEnabled(),
|
||||
activate: true,
|
||||
$title: 'File'
|
||||
};
|
||||
|
@ -37,9 +37,13 @@ const TPL = `
|
||||
export default class ImagePropertiesWidget extends TabAwareWidget {
|
||||
static getType() { return "image"; }
|
||||
|
||||
isEnabled() {
|
||||
return this.note && this.note.type === 'image';
|
||||
}
|
||||
|
||||
renderTitle(note) {
|
||||
return {
|
||||
show: note.type === 'image',
|
||||
show: this.isEnabled(),
|
||||
activate: true,
|
||||
$title: 'Image'
|
||||
};
|
||||
|
@ -15,9 +15,13 @@ const TPL = `
|
||||
export default class NotePropertiesWidget extends TabAwareWidget {
|
||||
static getType() { return "note-properties"; }
|
||||
|
||||
isEnabled() {
|
||||
return this.note && !!this.note.getLabelValue('pageUrl');
|
||||
}
|
||||
|
||||
renderTitle(note) {
|
||||
return {
|
||||
show: !!note.getLabelValue('pageUrl'),
|
||||
show: this.isEnabled(),
|
||||
activate: true,
|
||||
$title: 'Info'
|
||||
};
|
||||
|
@ -184,9 +184,13 @@ for (const clazz of [
|
||||
export default class SearchDefinitionWidget extends TabAwareWidget {
|
||||
static getType() { return "search"; }
|
||||
|
||||
isEnabled() {
|
||||
return this.note && this.note.type === 'search';
|
||||
}
|
||||
|
||||
renderTitle(note) {
|
||||
return {
|
||||
show: note.type === 'search',
|
||||
show: this.isEnabled(),
|
||||
activate: true,
|
||||
$title: 'Search'
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user