From 2317d9bac8342d20bb4dcbbd596dab722643580d Mon Sep 17 00:00:00 2001 From: glacials Date: Mon, 17 Feb 2020 11:46:59 -0800 Subject: [PATCH] Fix blank tooltips --- app/helpers/application_helper.rb | 2 +- app/helpers/delta_helper.rb | 2 +- app/javascript/packs/application.js | 6 +++++- app/views/races/show.slim | 2 +- package.json | 2 +- yarn.lock | 4 ++-- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 898b44ce6..b139145a1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/helpers/delta_helper.rb b/app/helpers/delta_helper.rb index 7d58c7de8..aaff64012 100644 --- a/app/helpers/delta_helper.rb +++ b/app/helpers/delta_helper.rb @@ -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 diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index f0406414c..0ed86ca94 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -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); diff --git a/app/views/races/show.slim b/app/views/races/show.slim index f89caa784..951bb8837 100644 --- a/app/views/races/show.slim +++ b/app/views/races/show.slim @@ -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' diff --git a/package.json b/package.json index 32d95362d..713cae960 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index 7b086d113..09ba97ef1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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== @@ -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==