Skip to content

Commit

Permalink
Merge pull request #77 from edrthomas/scroll
Browse files Browse the repository at this point in the history
Add scrolling, fixes #61
  • Loading branch information
edrthomas committed Jul 19, 2019
2 parents 2b24d7a + bd27917 commit 61cda9a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Empty file modified scripts/build.sh 100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions src/components/table.js
Expand Up @@ -3,6 +3,11 @@ var fs = require('fs');
module.exports = {
props: ['data', 'columns'],
methods: {
scrollFix: function(anchor) {
setTimeout(() => $('html, body').animate({
scrollTop: document.querySelectorAll('[name="' + anchor + '"]')[0].getBoundingClientRect().top - 70 + window.pageYOffset || document.documentElement.scrollTop
}, 1000), 1)
},
hasHTMLLink: function(string) {
if(string !== undefined) {
return string.includes("href");
Expand Down
2 changes: 1 addition & 1 deletion src/components/table.vue
Expand Up @@ -37,7 +37,7 @@
</td>
<td v-if="columns.indexOf('specification') !== -1">
<div v-if="item.specificationAnchor">
<router-link class="nav-link" to="/references">
<router-link class="nav-link" to="/references" @click.native="scrollFix(item.specificationAnchor)"">
{{ item.specification }}
</router-link>
</div>
Expand Down

0 comments on commit 61cda9a

Please sign in to comment.