12
12
<div class =" classware-layout" >
13
13
<div class =" row" >{{ $t('message.choose_layout') }}</div >
14
14
<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)" >
16
16
<img class =" layout" :class =" {'selected': setting.size == selectedGridSize}" :src =" setting.pic" >
17
17
</div >
18
18
</div >
@@ -36,18 +36,7 @@ export default {
36
36
props: [' classwareId' ],
37
37
data () {
38
38
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: [],
51
40
selectedGridSize: 2 ,
52
41
classwareInfo: {}
53
42
}
@@ -92,6 +81,7 @@ export default {
92
81
this .classwareInfo = {
93
82
name: this .$t (' message.all' )
94
83
}
84
+ this .selectedGridSize = db .getDefaultGridSize ().row
95
85
} else {
96
86
this .classwareInfo = db .getClasswareItemByUuid (this .classwareId )
97
87
if (this .classwareInfo .row ) {
@@ -100,6 +90,38 @@ export default {
100
90
this .selectedGridSize = db .getDefaultGridSize ().row
101
91
}
102
92
}
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
+ }
103
125
window .ga .trackEvent (' USER_EVENT' , ' DISPLAY_COURSE_SETTING' , ' ENTER' )
104
126
},
105
127
mounted () {
0 commit comments