Explorar el Código

fix: scroll anchor preventing text selection

Nick hace 5 años
padre
commit
c29d11f775
Se han modificado 2 ficheros con 7 adiciones y 11 borrados
  1. 7 1
      client/themes/default/components/page.vue
  2. 0 10
      client/themes/default/scss/app.scss

+ 7 - 1
client/themes/default/components/page.vue

@@ -247,7 +247,7 @@ export default {
       upBtnShown: false,
       scrollOpts: {
         duration: 1500,
-        offset: -75,
+        offset: 0,
         easing: 'easeInOutCubic'
       },
       scrollStyle: {
@@ -309,6 +309,12 @@ export default {
   mounted () {
     Prism.highlightAllUnder(this.$refs.container)
     this.navShown = this.$vuetify.breakpoint.smAndUp
+
+    this.$nextTick(() => {
+      if (window.location.hash && window.location.hash.length > 1) {
+        this.$vuetify.goTo(window.location.hash, this.scrollOpts)
+      }
+    })
   },
   methods: {
     goHome () {

+ 0 - 10
client/themes/default/scss/app.scss

@@ -25,16 +25,6 @@
   h1, h2, h3, h4, h5, h6 {
     position: relative;
 
-    &:before {
-      display: block;
-      content: " ";
-      width: 1px;
-      margin-top: -75px;
-      height: 75px;
-      visibility: hidden;
-      z-index: -1;
-    }
-
     &:first-child {
       padding-top: 0;
     }