Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit 0ae61e4

Browse files
authored
fix(sidebar): scroll when there are a lot of languages (#24)
Closes #23
1 parent 0da8910 commit 0ae61e4

File tree

4 files changed

+40
-61
lines changed

4 files changed

+40
-61
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ npm run build
5252
npm test
5353

5454
# lint all JS/Vue component files in `src/`
55-
npm run lint
55+
npm run eslint
5656

5757
```
5858

appveyor.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "code-notes",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"author": "Laurent THIEBAULT <[email protected]>",
55
"description": "A simple code snippet manager for developers built with Electron 🚀",
66
"license": "MIT",

src/renderer/Sidebar.vue

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,59 @@
55
</p>
66
<ul class="menu-list">
77
<li>
8-
<a :class="{'is-active': languageSelected === 'all'}" @click="selectLanguage('all')">All <b-tag class="is-pulled-right" type="is-dark">{{totalFiles}}</b-tag></a>
8+
<a :class="{'is-active': languageSelected === 'all'}" @click="selectLanguage('all')">All
9+
<b-tag class="is-pulled-right" type="is-dark">{{totalFiles}}</b-tag>
10+
</a>
911
</li>
1012
<li v-for="(list, value) in Array.from(languages)">
11-
<a :class="{'is-active': languageSelected === list[0]}" @click="selectLanguage(list[0])">{{list[0] | capitalize}} <b-tag class="is-pulled-right" type="is-dark">{{list[1]}}</b-tag></a>
13+
<a :class="{'is-active': languageSelected === list[0]}" @click="selectLanguage(list[0])">{{list[0] | capitalize}}
14+
<b-tag class="is-pulled-right" type="is-dark">{{list[1]}}</b-tag>
15+
</a>
1216
</li>
1317
</ul>
1418
</aside>
1519
</template>
1620

1721
<script>
18-
import Vuex from 'vuex';
22+
import Vuex from 'vuex';
23+
// eslint-disable-next-line
24+
import { screen } from 'electron';
1925
20-
export default {
21-
name: 'cn-sidebar',
22-
data() {
23-
return {};
24-
},
25-
methods: {
26-
selectLanguage(language) {
27-
this.$store.dispatch('selectLanguage', language);
26+
export default {
27+
name: 'cn-sidebar',
28+
data() {
29+
return {
30+
};
2831
},
29-
},
30-
computed: {
31-
...Vuex.mapGetters(['languages', 'notes', 'languageSelected', 'totalFiles']),
32-
},
33-
};
32+
methods: {
33+
selectLanguage(language) {
34+
this.$store.dispatch('selectLanguage', language);
35+
},
36+
},
37+
computed: {
38+
...Vuex.mapGetters(['languages', 'notes', 'languageSelected', 'totalFiles'])
39+
},
40+
};
3441
</script>
3542

3643
<style lang="scss" scoped>
37-
aside {
38-
position: fixed;
39-
top: 48px;
40-
width: 22%;
41-
margin-top: 24px;
44+
aside {
45+
position: fixed;
46+
top: 48px;
47+
width: 22%;
48+
margin-top: 24px;
49+
50+
ul {
51+
overflow: auto;
52+
max-height: 77vh;
4253
43-
li {
44-
margin: 5px 0;
54+
li {
55+
margin: 5px 0;
4556
46-
a {
47-
padding-bottom: 11px !important;
57+
a {
58+
padding-bottom: 11px !important;
59+
}
60+
}
4861
}
4962
}
50-
}
5163
</style>

0 commit comments

Comments
 (0)