disable property widgets if not applicable

This commit is contained in:
zadam 2021-01-31 20:07:56 +01:00
parent 6068bd7c44
commit 17073096cf
4 changed files with 20 additions and 4 deletions

View File

@ -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'
};

View 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'
};

View File

@ -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'
};

View File

@ -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'
};