Use custom plugin icon titles where given

This commit is contained in:
Joel Collins 2020-03-03 09:56:23 +00:00
parent 603c7746ce
commit c1234df9ae
2 changed files with 17 additions and 7 deletions

View file

@ -8,7 +8,7 @@
>
<slot></slot>
<div class="tabtitle">
{{ title }}
{{ computedTitle }}
</div>
</a>
</template>
@ -22,6 +22,11 @@ export default {
type: String,
required: true
},
title: {
type: String,
required: false,
default: undefined
},
currentTab: {
type: String,
required: true
@ -35,15 +40,19 @@ export default {
},
computed: {
title: function() {
// Get the last section of a fully qualified name
var topName = this.id.split(".").pop();
// Make first character uppercase, then add the rest of the string
return topName.charAt(0).toUpperCase() + topName.slice(1);
computedTitle: function() {
if (this.title !== undefined) {
return this.title;
} else {
// Get the last section of a fully qualified name
var topName = this.id.split(".").pop();
// Make first character uppercase, then add the rest of the string
return topName.charAt(0).toUpperCase() + topName.slice(1);
}
},
tooltipOptions: function() {
return `pos: right; title: ${this.title}; delay: 500`;
return `pos: right; title: ${this.computedTitle}; delay: 500`;
},
classObject: function() {

View file

@ -48,6 +48,7 @@
v-for="plugin in pluginsGuiList"
:id="plugin.id"
:key="plugin.id"
:title="plugin.title"
:require-connection="plugin.requiresConnection"
:current-tab="currentTab"
:click-callback="updatePlugins"