Skip to content

Commit

Permalink
💄 Show provider in tooltip, if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed Sep 5, 2021
1 parent 27dd60a commit 3141565
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/LinkItems/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default {
color: String, // Optional text and icon color, specified in hex code
backgroundColor: String, // Optional item background color
url: String, // URL to the resource, optional but recommended
provider: String, // Optional provider name, for external apps
hotkey: Number, // Shortcut for quickly launching app
target: { // Where resource will open, either 'newtab', 'sametab' or 'modal'
type: String,
Expand Down Expand Up @@ -131,14 +132,16 @@ export default {
},
/* Returns configuration object for the tooltip */
getTooltipOptions() {
if (!this.description) return {}; // If no description, then skip
const hotkeyText = this.hotkey ? `\nPress '${this.hotkey}' to launch` : '';
if (!this.description && !this.provider) return {}; // If no description, then skip
const description = this.description ? this.description : '';
const providerText = this.provider ? `<b>Provider</b>: ${this.provider}` : '';
const lb1 = description && providerText ? '<br>' : '';
const hotkeyText = this.hotkey ? `<br>Press '${this.hotkey}' to launch` : '';
return {
disabled: !this.description,
content: this.description + hotkeyText,
content: providerText + lb1 + description + hotkeyText,
trigger: 'hover focus',
hideOnTargetClick: true,
html: false,
html: true,
placement: this.statusResponse ? 'left' : 'auto',
delay: { show: 600, hide: 200 },
classes: 'item-description-tooltip',
Expand Down
1 change: 1 addition & 0 deletions src/components/LinkItems/Section.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
:statusCheckHeaders="item.statusCheckHeaders"
:itemSize="newItemSize"
:hotkey="item.hotkey"
:provider="item.provider"
:enableStatusCheck="shouldEnableStatusCheck(item.statusCheck)"
:statusCheckInterval="getStatusCheckInterval()"
:statusCheckAllowInsecure="item.statusCheckAllowInsecure"
Expand Down

0 comments on commit 3141565

Please sign in to comment.