Просмотр исходного кода

Fix switch tooltip not showing the proper text on new plans page (#8608)

GitOrigin-RevId: efb49c7a6045b6a5b26a0b0d84a24d151f76f192
M Fahru 4 лет назад
Родитель
Сommit
ac1f72263c

+ 5 - 0
services/web/frontend/js/pages/user/subscription/plans-v2/plans-v2-m-a-switch.js

@@ -24,6 +24,11 @@ export function switchMonthlyAnnual(currentMonthlyAnnualSwitchValue) {
     currentMonthlyAnnualSwitchValue === 'annual'
   )
 
+  document.querySelectorAll('[data-ol-tooltip-period]').forEach(el => {
+    const period = el.getAttribute('data-ol-tooltip-period')
+    el.hidden = period !== currentMonthlyAnnualSwitchValue
+  })
+
   document
     .querySelectorAll('[data-ol-plans-v2-table-annual-price-before-discount]')
     .forEach(el => {