File tree 2 files changed +11
-13
lines changed
2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ export class Styler {
5
5
return document . querySelectorAll ( className ) ;
6
6
}
7
7
8
+ fillPicsByElData ( className ) { //заполняет массив объектами
9
+ this . findPics ( className )
10
+ . forEach ( el => {
11
+ this . pics . push ( this . findNGive ( el ) )
12
+ } )
13
+ }
14
+
8
15
calcStyles ( elData1 , elData2 , screenWidthFresh = document . documentElement . clientWidth ) {
9
16
let wider , narrower , taller , lower ;
10
17
let sumOfWi = elData1 . width + elData2 . width ;
Original file line number Diff line number Diff line change @@ -51,17 +51,12 @@ export const About = {
51
51
</div>` ,
52
52
data ( ) {
53
53
return {
54
- //ширина экрана - будем следить за ней через Watch
55
- screenWidth :document . documentElement . clientWidth ,
54
+
56
55
}
57
56
} ,
58
57
mounted ( ) {
59
- window . onload = ( ) => {
60
- styler . findPics ( '.about-pic' ) . forEach ( el => {
61
- styler . pics . push ( styler . findNGive ( el ) )
62
- } )
63
- console . log ( styler . pics )
64
-
58
+ window . onresize = ( ) => {
59
+ console . log ( document . documentElement . clientWidth )
65
60
} ;
66
61
67
62
} ,
@@ -75,11 +70,7 @@ export const About = {
75
70
76
71
} ,
77
72
watch :{
78
- screenWidth ( ) { //если ресайзнули окно - делать это:
79
- //styler.pics[0].el.style = 'width:300px'
80
- console . log ( 'resize' )
81
- //styler.calcStyles(styler.pics[0], styler.pics[1])
82
- }
73
+
83
74
}
84
75
85
76
}
You can’t perform that action at this time.
0 commit comments