Skip to content

Commit

Permalink
Fix blank tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
glacials committed Feb 17, 2020
1 parent 1307669 commit 2317d9b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def user_badge(user, override: nil, link: true)
title = "#{user} is a Splits.io staff member!"
end

link_to(user, user_path(user), class: "badge #{badge}", content: title, 'v-tippy' => true)
link_to(user, user_path(user), class: "badge #{badge}", content: title, 'v-tippy' => '') # Must be '', not true
end

# patreon_url returns the URL for the Splits.io Patreon page. If checkout is true, it returns the URL for the
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/delta_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ def delta(base, compare, subject:, better: :lower)
classes << 'text-danger'
end

tag.span(text, class: classes, content: "Compared to #{subject}", 'v-tippy' => true)
tag.span(text, class: classes, content: "Compared to #{subject}", 'v-tippy' => '') # Must be '', not true
end
end
6 changes: 5 additions & 1 deletion app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ import SpeedRunsLiveRaceList from '../vue/SpeedRunsLiveRaceList.vue'

Vue.use(TurbolinksAdapter)
Vue.use(VueTippy, {
onShow: instance => !!instance.props.content, // Makes null `content` hide the tooltip, not show a blank one
onShow: instance => {
if (!instance.props.content) {
return false
} // Makes null `content` hide the tooltip, not show a blank one
},
})
Vue.component("tippy", TippyComponent);

Expand Down
2 changes: 1 addition & 1 deletion app/views/races/show.slim
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ race inline-template=true race-id=@race.id v-cloak=true
span.text-danger v-else-if='error' => icon('fas', 'exclamation-triangle')
template v-else=true => icon('fas', 'comment')
- @race.chat_messages.includes(user: [:twitch, :google]).order(created_at: :desc).each do |msg|
= render partial: 'chat_messages/show', locals: {chat_message: msg}
= render 'chat_messages/show', chat_message: msg
.list-group-item.p-0
.media
img.mr-3 src=asset_path('logo-darkbg-breathingroom.png') width=25 height=25 alt='Splits.io image only logo'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"turbolinks": "^5.2.0",
"turbolinks-animate": "^3.2.1",
"underscore": "^1.8.3",
"vue": "^2.6.10",
"vue": "^2.6.11",
"vue-bootstrap-typeahead": "^0.2.6",
"vue-loader": "^15.7.0",
"vue-multiselect": "^2.1.6",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7370,7 +7370,7 @@ vue-bootstrap-typeahead@^0.2.6:
resize-observer-polyfill "^1.5.0"
vue "^2.5.17"

vue-hot-reload-api@^2.3.0:
vue-hot-reload-api@^2.3.0, vue-hot-reload-api@^2.3.4:
version "2.3.4"
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz#532955cc1eb208a3d990b3a9f9a70574657e08f2"
integrity sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==
Expand Down Expand Up @@ -7427,7 +7427,7 @@ vue-turbolinks@^2.0.4:
dependencies:
vue "^2.2.4"

vue@^2.2.4, vue@^2.5.17, vue@^2.6.10:
vue@^2.2.4, vue@^2.5.17, vue@^2.6.11:
version "2.6.11"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5"
integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==
Expand Down

0 comments on commit 2317d9b

Please sign in to comment.