Skip to content

Commit

Permalink
fix: update vue-scrollactive patch to delay initial selected item in …
Browse files Browse the repository at this point in the history
…sidebar for 50ms
  • Loading branch information
matthamil committed Mar 18, 2021
1 parent 55273bd commit 319af7b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ commands:
- checkout
- restore_cache:
keys:
- yarn-cache-{{ checksum "yarn.lock" }}-{{ checksum "patches/github-slugger+1.3.0.patch" }}
- yarn-cache-{{ checksum "yarn.lock" }}-{{ checksum "patches/github-slugger+1.3.0.patch" }}-{{ checksum "patches/vue-scrollactive+0.9.3.patch" }}
- run:
name: Install Dependencies
command: yarn --frozen-lockfile
- save_cache:
key: yarn-cache-{{ checksum "yarn.lock" }}-{{ checksum "patches/github-slugger+1.3.0.patch" }}
key: yarn-cache-{{ checksum "yarn.lock" }}-{{ checksum "patches/github-slugger+1.3.0.patch" }}-{{ checksum "patches/vue-scrollactive+0.9.3.patch" }}
paths:
- node_modules
- run:
Expand Down
39 changes: 37 additions & 2 deletions patches/vue-scrollactive+0.9.3.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,43 @@
diff --git a/node_modules/vue-scrollactive/dist/vue-scrollactive.min.js b/node_modules/vue-scrollactive/dist/vue-scrollactive.min.js
index cfc4ecb..170528f 100644
index cfc4ecb..024dca4 100644
--- a/node_modules/vue-scrollactive/dist/vue-scrollactive.min.js
+++ b/node_modules/vue-scrollactive/dist/vue-scrollactive.min.js
@@ -382,9 +382,7 @@
@@ -243,19 +243,21 @@
},
},
mounted: function () {
- var t = window.MutationObserver || window.WebKitMutationObserver;
- this.observer ||
- ((this.observer = new t(this.initScrollactiveItems)),
- this.observer.observe(this.$refs['scrollactive-nav-wrapper'], {
- childList: !0,
- subtree: !0,
- })),
- this.initScrollactiveItems(),
- this.removeActiveClass(),
- (this.currentItem = this.getItemInsideWindow()),
- this.currentItem && this.currentItem.classList.add(this.activeClass),
- this.scrollOnStart && this.scrollToHashElement(),
- this.scrollContainer.addEventListener('scroll', this.onScroll);
+ setTimeout(() => {
+ var t = window.MutationObserver || window.WebKitMutationObserver;
+ this.observer ||
+ ((this.observer = new t(this.initScrollactiveItems)),
+ this.observer.observe(this.$refs['scrollactive-nav-wrapper'], {
+ childList: !0,
+ subtree: !0,
+ })),
+ this.initScrollactiveItems(),
+ this.removeActiveClass(),
+ (this.currentItem = this.getItemInsideWindow()),
+ this.currentItem && this.currentItem.classList.add(this.activeClass),
+ this.scrollOnStart && this.scrollToHashElement(),
+ this.scrollContainer.addEventListener('scroll', this.onScroll);
+ }, 50)
},
updated: function () {
this.initScrollactiveItems();
@@ -382,9 +384,7 @@
}
},
pushHashToUrl: function (t) {
Expand Down

0 comments on commit 319af7b

Please sign in to comment.