Hide settings button if plugin doesn't have any settings

This commit is contained in:
Jiiks 2018-01-25 14:50:07 +02:00
parent 5faaaa0276
commit e66c1ce447
3 changed files with 3 additions and 6 deletions

View File

@ -17,6 +17,7 @@ class Plugin {
constructor(pluginInternals) {
this.__pluginInternals = pluginInternals;
this.hasSettings = this.pluginConfig && this.pluginConfig.length > 0;
this.start = this.start.bind(this);
this.stop = this.stop.bind(this);
}

View File

@ -14,7 +14,7 @@
<div class="bd-plugin-extra">v{{plugin.version}} by {{plugin.authors.join(', ').replace(/,(?!.*,)/gmi, ' and')}}</div>
<div class="bd-controls">
<ButtonGroup>
<Button :onClick="() => showSettings(plugin)">
<Button v-if="plugin.hasSettings" :onClick="() => showSettings(plugin)">
<MiSettings/>
</Button>
<Button :onClick="() => reloadPlugin(plugin)">

View File

@ -6,9 +6,5 @@
"description": "Example Plugin 2 Description"
},
"main": "index.js",
"defaultConfig": [
{
"foo": "bar"
}
]
"defaultConfig": []
}