Skip to content

Commit b898dcf

Browse files
committed
add 3x3 layout option for pads
1 parent b9fb8fd commit b898dcf

File tree

2 files changed

+35
-13
lines changed

2 files changed

+35
-13
lines changed

src/components/YdDisplayClasswareSettings.vue

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="classware-layout">
1313
<div class="row">{{ $t('message.choose_layout') }}</div>
1414
<div class="row">
15-
<div v-for="setting in gridSettings" class="col col-50" :key="setting.id" @click="select(setting.size)">
15+
<div v-for="setting in gridSettings" class="col" :class="gridSettings.length === 3 ? 'col-33' : 'col-50'" :key="setting.id" @click="select(setting.size)">
1616
<img class="layout" :class="{'selected': setting.size == selectedGridSize}" :src="setting.pic">
1717
</div>
1818
</div>
@@ -36,18 +36,7 @@ export default {
3636
props: ['classwareId'],
3737
data() {
3838
return {
39-
gridSettings: [
40-
{
41-
id: 0,
42-
size: 1,
43-
pic: 'static/img/parent_settingspop_layout1_1.png'
44-
},
45-
{
46-
id: 1,
47-
size: 2,
48-
pic: 'static/img/parent_settingspop_layout2_2.png'
49-
}
50-
],
39+
gridSettings: [],
5140
selectedGridSize: 2,
5241
classwareInfo: {}
5342
}
@@ -92,6 +81,7 @@ export default {
9281
this.classwareInfo = {
9382
name: this.$t('message.all')
9483
}
84+
this.selectedGridSize = db.getDefaultGridSize().row
9585
} else {
9686
this.classwareInfo = db.getClasswareItemByUuid(this.classwareId)
9787
if (this.classwareInfo.row) {
@@ -100,6 +90,38 @@ export default {
10090
this.selectedGridSize = db.getDefaultGridSize().row
10191
}
10292
}
93+
if (window.innerWidth < 480) {
94+
this.gridSettings = [
95+
{
96+
id: 0,
97+
size: 1,
98+
pic: 'static/img/parent_settingspop_layout1_1.png'
99+
},
100+
{
101+
id: 1,
102+
size: 2,
103+
pic: 'static/img/parent_settingspop_layout2_2.png'
104+
}
105+
]
106+
} else {
107+
this.gridSettings = [
108+
{
109+
id: 0,
110+
size: 1,
111+
pic: 'static/img/parent_settingspop_layout1_1.png'
112+
},
113+
{
114+
id: 1,
115+
size: 2,
116+
pic: 'static/img/parent_settingspop_layout2_2.png'
117+
},
118+
{
119+
id: 2,
120+
size: 3,
121+
pic: 'static/img/parent_settingspop_layout3_3.png'
122+
}
123+
]
124+
}
103125
window.ga.trackEvent('USER_EVENT', 'DISPLAY_COURSE_SETTING', 'ENTER')
104126
},
105127
mounted() {
13 KB
Loading

0 commit comments

Comments
 (0)