Skip to content

Commit 8ccffea

Browse files
author
Damian Dulisz
committed
update version, docs WIP
1 parent 8aca2ab commit 8ccffea

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

docs/main.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,26 @@ new Vue({
5757
['getting-started', 0],
5858
['select-primitive', 0],
5959
['select-object', 0],
60-
['multiselect', 0],
60+
['select-search', 0],
6161
['multiselect-search', 0],
6262
['ajax', 0],
6363
['tagging', 0],
6464
['vuex', 0],
6565
['custom', 0]
66-
]
66+
],
67+
scroll: 0
6768
}
6869
},
6970
computed: {
7071
isInvalid () {
7172
return this.isTouched && this.exampleValue6.length === 0
7273
},
7374
currentPosition () {
74-
return '#getting-started'
75+
for (let i = 1; i < this.navPositions.length - 1; i++) {
76+
if (this.scroll >= this.navPositions[i][1] && this.scroll < this.navPositions[i + 1][1]) {
77+
return this.navPositions[i - 1][0]
78+
}
79+
}
7580
}
7681
},
7782
methods: {
@@ -145,26 +150,26 @@ new Vue({
145150
onRemove (option) {
146151
console.log('@remove: ', option)
147152
},
148-
adjustStickyNav () {
153+
adjustNav () {
154+
console.log('adjust')
155+
this.scroll = window.scrollY
156+
console.log(this.scroll)
157+
console.log(this.currentPosition)
149158
this.isNavSticky = window.scrollY > window.innerHeight
150159
},
151160
calculateNavPositions () {
152161
/*eslint-disable */
153162
for (let position of this.navPositions) {
154163
const elem = document.getElementById(position[0])
155-
if (elem) position[1] = elem.offsetTop
164+
if (elem) position[1] = elem.offsetTop - 200
156165
}
157-
console.log(this.navPositions)
158-
this.navPositions.sort((a, b) => {
159-
return a[1] - b[1]
160-
})
161-
console.log(this.navPositions)
166+
this.navPositions = this.navPositions.sort((a, b) => a[1] - b[1])
162167
/*eslint-enable */
163168
}
164169
},
165170
ready () {
166-
this.adjustStickyNav()
167-
window.addEventListener('scroll', throttle(this.adjustStickyNav, 50))
171+
this.adjustNav()
172+
window.addEventListener('scroll', throttle(this.adjustNav, 50))
168173
this.calculateNavPositions()
169174
}
170175
})

docs/partials/_nav.jade

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ ul.list(
1212
+nav-element('Select (primitive)', 'select-primitive')
1313
+nav-element('Select (object)', 'select-object')
1414
+nav-element('Select with search', 'select-search')
15-
+nav-element('Multiselect', 'multiselect')
1615
+nav-element('Multiselect with search', 'multiselect-search')
1716
+nav-element('Asynchronous select', 'ajax')
1817
+nav-element('Tagging', 'tagging')

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-multiselect",
3-
"version": "0.3.1",
3+
"version": "1.0.0",
44
"description": "Multiselect component for vue.js",
55
"author": "Damian Dulisz <damian.dulisz@monterail.com>",
66
"private": false,

0 commit comments

Comments
 (0)