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 {
|
export default class FilePropertiesWidget extends TabAwareWidget {
|
||||||
static getType() { return "file"; }
|
static getType() { return "file"; }
|
||||||
|
|
||||||
|
isEnabled() {
|
||||||
|
return this.note && this.note.type === 'file';
|
||||||
|
}
|
||||||
|
|
||||||
renderTitle(note) {
|
renderTitle(note) {
|
||||||
return {
|
return {
|
||||||
show: note.type === 'file',
|
show: this.isEnabled(),
|
||||||
activate: true,
|
activate: true,
|
||||||
$title: 'File'
|
$title: 'File'
|
||||||
};
|
};
|
||||||
|
@ -37,9 +37,13 @@ const TPL = `
|
|||||||
export default class ImagePropertiesWidget extends TabAwareWidget {
|
export default class ImagePropertiesWidget extends TabAwareWidget {
|
||||||
static getType() { return "image"; }
|
static getType() { return "image"; }
|
||||||
|
|
||||||
|
isEnabled() {
|
||||||
|
return this.note && this.note.type === 'image';
|
||||||
|
}
|
||||||
|
|
||||||
renderTitle(note) {
|
renderTitle(note) {
|
||||||
return {
|
return {
|
||||||
show: note.type === 'image',
|
show: this.isEnabled(),
|
||||||
activate: true,
|
activate: true,
|
||||||
$title: 'Image'
|
$title: 'Image'
|
||||||
};
|
};
|
||||||
|
@ -15,9 +15,13 @@ const TPL = `
|
|||||||
export default class NotePropertiesWidget extends TabAwareWidget {
|
export default class NotePropertiesWidget extends TabAwareWidget {
|
||||||
static getType() { return "note-properties"; }
|
static getType() { return "note-properties"; }
|
||||||
|
|
||||||
|
isEnabled() {
|
||||||
|
return this.note && !!this.note.getLabelValue('pageUrl');
|
||||||
|
}
|
||||||
|
|
||||||
renderTitle(note) {
|
renderTitle(note) {
|
||||||
return {
|
return {
|
||||||
show: !!note.getLabelValue('pageUrl'),
|
show: this.isEnabled(),
|
||||||
activate: true,
|
activate: true,
|
||||||
$title: 'Info'
|
$title: 'Info'
|
||||||
};
|
};
|
||||||
|
@ -184,9 +184,13 @@ for (const clazz of [
|
|||||||
export default class SearchDefinitionWidget extends TabAwareWidget {
|
export default class SearchDefinitionWidget extends TabAwareWidget {
|
||||||
static getType() { return "search"; }
|
static getType() { return "search"; }
|
||||||
|
|
||||||
|
isEnabled() {
|
||||||
|
return this.note && this.note.type === 'search';
|
||||||
|
}
|
||||||
|
|
||||||
renderTitle(note) {
|
renderTitle(note) {
|
||||||
return {
|
return {
|
||||||
show: note.type === 'search',
|
show: this.isEnabled(),
|
||||||
activate: true,
|
activate: true,
|
||||||
$title: 'Search'
|
$title: 'Search'
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user