File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,13 @@ export default {
37
37
methods: {
38
38
scrollSpy () {
39
39
const scrollPosition = document .documentElement .scrollTop || document .body .scrollTop
40
- for ( let s of this .sections ) {
40
+ this .sections . forEach ( s => {
41
41
// 420 = firstSection.getBoundingClientRect().top (when body.scrollTop = 0)
42
42
// = nav.height + header.height + firstSection.margin-top - 6 (for offset)
43
43
if (s .el .offsetTop + 420 <= scrollPosition) {
44
44
this .active = s .id
45
45
}
46
- }
46
+ })
47
47
}
48
48
}
49
49
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export default {
38
38
let element = {}
39
39
const rect = this .$el .getBoundingClientRect ()
40
40
const body = document .body
41
- for ( let type of [' Top' ,' Left' ]) {
41
+ [' Top' ,' Left' ]. forEach ( type => {
42
42
let t = type .toLowerCase ()
43
43
let ret = window [' page' + (type=== ' Top' ? ' Y' : ' X' ) + ' Offset' ]
44
44
const method = ' scroll' + type
@@ -52,7 +52,7 @@ export default {
52
52
}
53
53
scroll[t] = ret
54
54
element[t] = scroll[t] + rect[t] - (this .$el [' client' + type] || body[' client' + type] || 0 )
55
- }
55
+ })
56
56
let fix = scroll .top > element .top - this .offset
57
57
if (this .affixed !== fix) { this .affixed = fix }
58
58
}
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ export default {
142
142
selected () {
143
143
if (this .options .length === 0 ) { return ' ' }
144
144
let foundItems = []
145
- for ( var item of this .values ) {
145
+ this .values . forEach ( item => {
146
146
if (~ [' number' , ' string' ].indexOf (typeof item)) {
147
147
let option = null
148
148
if (this .options .some (o => {
@@ -152,7 +152,7 @@ export default {
152
152
}
153
153
})) { foundItems .push (option[this .optionsLabel ] || option) }
154
154
}
155
- }
155
+ })
156
156
return foundItems .join (' , ' )
157
157
},
158
158
classes () {
@@ -275,9 +275,9 @@ export default {
275
275
this .loading = true
276
276
getJSON (this .url ).then (data => {
277
277
let options = []
278
- for ( let opc of data) {
278
+ data . forEach ( opc => {
279
279
if (opc[this .optionsValue ] !== undefined && opc[this .optionsLabel ] !== undefined ) options .push (opc)
280
- }
280
+ })
281
281
this .options = options
282
282
if (! options .length ) { this .value = this .value instanceof Array ? [] : null }
283
283
}).always (() => {
Original file line number Diff line number Diff line change @@ -96,8 +96,6 @@ class NodeList {
96
96
return this
97
97
}
98
98
delete ( ) {
99
- let list = NodeListJS ( [ ] , this . owner )
100
- let splice = index => ArrayProto . splice . apply ( )
101
99
for ( let i = this . length - 1 , el = this [ i ] ; i ; el = this [ -- i ] ) {
102
100
if ( el . remove ) {
103
101
el . remove ( )
@@ -107,6 +105,7 @@ class NodeList {
107
105
this . splice ( i , 1 )
108
106
}
109
107
}
108
+ if ( this . length ) console . warn ( 'NodeList: Some nodes could not be deleted.' )
110
109
return this
111
110
}
112
111
shift ( amount ) {
You can’t perform that action at this time.
0 commit comments