mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #19664 from overleaf/jel-plans-js
[web] Fix interstitial payment page when loaded with a hash in the URL GitOrigin-RevId: 81cdf27cd13aed149f5453a997df05949eb6b01b
This commit is contained in:
parent
2a811e1b20
commit
06b66c7ccc
2 changed files with 27 additions and 14 deletions
|
@ -7,6 +7,7 @@ export function toggleMonthlyAnnualSwitching(
|
||||||
const containerEl = document.querySelector(
|
const containerEl = document.querySelector(
|
||||||
'[data-ol-plans-v2-m-a-switch-container]'
|
'[data-ol-plans-v2-m-a-switch-container]'
|
||||||
)
|
)
|
||||||
|
if (containerEl) {
|
||||||
const checkbox = containerEl.querySelector('input[type="checkbox"]')
|
const checkbox = containerEl.querySelector('input[type="checkbox"]')
|
||||||
|
|
||||||
containerEl.classList.toggle('disabled', view === 'group')
|
containerEl.classList.toggle('disabled', view === 'group')
|
||||||
|
@ -16,6 +17,7 @@ export function toggleMonthlyAnnualSwitching(
|
||||||
|
|
||||||
switchMonthlyAnnual(currentMonthlyAnnualSwitchValue)
|
switchMonthlyAnnual(currentMonthlyAnnualSwitchValue)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function switchMonthlyAnnual(currentMonthlyAnnualSwitchValue) {
|
export function switchMonthlyAnnual(currentMonthlyAnnualSwitchValue) {
|
||||||
const el = document.querySelector('[data-ol-plans-v2-m-a-tooltip]')
|
const el = document.querySelector('[data-ol-plans-v2-m-a-tooltip]')
|
||||||
|
|
|
@ -117,14 +117,24 @@ function selectTab(viewTab) {
|
||||||
el.hidden = el.getAttribute('data-ol-plans-v2-view') !== viewTab
|
el.hidden = el.getAttribute('data-ol-plans-v2-view') !== viewTab
|
||||||
})
|
})
|
||||||
|
|
||||||
document.querySelector('[data-ol-plans-v2-m-a-tooltip]').hidden =
|
const tooltipEl = document.querySelector('[data-ol-plans-v2-m-a-tooltip]')
|
||||||
viewTab === 'group'
|
if (tooltipEl) {
|
||||||
document.querySelector('[data-ol-plans-v2-license-picker-container]').hidden =
|
tooltipEl.hidden = viewTab === 'group'
|
||||||
viewTab !== 'group'
|
}
|
||||||
|
|
||||||
document
|
const licensePickerEl = document.querySelector(
|
||||||
.querySelector('[data-ol-plans-v2-m-a-switch-container]')
|
'[data-ol-plans-v2-license-picker-container]'
|
||||||
.setAttribute('data-ol-current-view', viewTab)
|
)
|
||||||
|
if (licensePickerEl) {
|
||||||
|
licensePickerEl.hidden = viewTab !== 'group'
|
||||||
|
}
|
||||||
|
|
||||||
|
const monthlyAnnualSwitch = document.querySelector(
|
||||||
|
'[data-ol-plans-v2-m-a-switch-container]'
|
||||||
|
)
|
||||||
|
if (monthlyAnnualSwitch) {
|
||||||
|
monthlyAnnualSwitch.setAttribute('data-ol-current-view', viewTab)
|
||||||
|
}
|
||||||
|
|
||||||
if (viewTab === 'group') {
|
if (viewTab === 'group') {
|
||||||
updateMainGroupPlanPricing()
|
updateMainGroupPlanPricing()
|
||||||
|
@ -208,9 +218,10 @@ function setUpGroupPlanPricingChange() {
|
||||||
|
|
||||||
function toggleUniversityInfo(viewTab) {
|
function toggleUniversityInfo(viewTab) {
|
||||||
const el = document.querySelector('[data-ol-plans-university-info-container]')
|
const el = document.querySelector('[data-ol-plans-university-info-container]')
|
||||||
|
if (el) {
|
||||||
el.hidden = viewTab !== 'student'
|
el.hidden = viewTab !== 'student'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This is the old scheme for hashing redirection
|
// This is the old scheme for hashing redirection
|
||||||
// This is deprecated and should be removed in the future
|
// This is deprecated and should be removed in the future
|
||||||
|
|
Loading…
Reference in a new issue