@appscode/design-system 1.0.43-alpha.80 → 1.0.43-alpha.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "1.0.43-alpha.80",
3
+ "version": "1.0.43-alpha.84",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <li>
2
+ <li ref="sidebarItem">
3
3
  <router-link
4
4
  :id="id"
5
5
  :title="title"
@@ -38,5 +38,27 @@ export default {
38
38
  default: "@/assets/images/icons/basic.svg",
39
39
  },
40
40
  },
41
+ watch: {
42
+ isActive: {
43
+ immediate: true,
44
+ handler(n) {
45
+ if (n) {
46
+ this.$nextTick(() => {
47
+ setTimeout(() => {
48
+ const top = (this.$refs.sidebarItem && this.$refs.sidebarItem.getBoundingClientRect().top) || 0;
49
+ // preventing scroll to options that are already visible
50
+ if (top > window.innerHeight - 200) {
51
+ // scroll to selected option item
52
+ this.$refs.sidebarItem.scrollIntoView({
53
+ behavior: 'smooth',
54
+ block: "center"
55
+ });
56
+ }
57
+ }, 500);
58
+ });
59
+ }
60
+ }
61
+ }
62
+ }
41
63
  };
42
64
  </script>