Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FidalMathew committed Feb 12, 2024
1 parent 5ed8042 commit 0e2fe6b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@
components: {
LanguageSwitcherModal,
},
mixins: [responsiveWindowMixin, languageSwitcherMixin],
mixins: [responsiveWindowMixin, languageSwitcherMixin],
props: {
parentBreakpoint: {
type: Number
parentBreakpoint: {
type: Number,
default: -1,
},
},
},
data() {
return {
showLanguageModal: false,
Expand All @@ -76,11 +77,10 @@
numVisibleLanguageBtns() {
// At visibleBtns = 0, only the "More languages" button will show
let visibleBtns = 4;
if (this.parentBreakpoint === undefined) {
visibleBtns = this.windowBreakpoint
}
else {
visibleBtns=this.parentBreakpoint
if (this.parentBreakpoint < 0) {
visibleBtns = this.windowBreakpoint;
} else {
visibleBtns = this.parentBreakpoint;
}
return Math.min(4, visibleBtns);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
max-width: $page-container-max-width;
padding-bottom: 5em;
margin: 5em auto 0;
&.windowIsSmall {
width: 100vw;
height: 100vh;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<template>

<OnboardingStepBase
ref="container"
:title="$tr('languageFormHeader')"
@continue="handleSubmit"
ref="container" @resize="updateWidth"
@resize="updateWidth"
>
<LanguageSwitcherList :parentBreakpoint="parentBreakpoint"/>
<LanguageSwitcherList :parentBreakpoint="parentBreakpoint" />
</OnboardingStepBase>

</template>
Expand All @@ -21,42 +22,42 @@
components: {
OnboardingStepBase,
LanguageSwitcherList,
},
},
data() {
return {
parentBreakpoint: 4
}
},
parentBreakpoint: 4,
};
},
mounted() {
this.updateWidth();
window.addEventListener('resize', this.updateWidth);
},
this.updateWidth();
window.addEventListener('resize', this.updateWidth);
},
beforeDestroy() {
window.removeEventListener('resize', this.updateWidth);
},
window.removeEventListener('resize', this.updateWidth);
},
inject: ['wizardService'],
methods: {
handleSubmit() {
this.wizardService.send('CONTINUE');
},
updateWidth() {
const element = this.$refs.container.$el
const width = element.offsetWidth
const element = this.$refs.container.$el;
const width = element.offsetWidth;
let num = 4;
if (width < 440) {
num = 0;
} else if(width < 520) {
} else if (width < 520) {
num = 1;
} else if(width < 600) {
} else if (width < 600) {
num = 2;
} else if (width < 660) {
num = 3;
} else {
num = 4;
}
this.parentBreakpoint = num;
},
this.parentBreakpoint = num;
},
},
$trs: {
languageFormHeader: {
Expand Down

0 comments on commit 0e2fe6b

Please sign in to comment.