8000 Revert "Fix header link (#1263)" (#445) · kazupon/vuejs.org@95177a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95177a9

Browse files
vuejs-jp-botre-fort
authored andcommitted
Revert "Fix header link (vuejs#1263)" (vuejs#445)
This reverts commit b73f126.
1 parent 06e88c4 commit 95177a9

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

themes/vue/source/css/_settings.styl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@ $info = #1C90F3
1919

2020
$radius = 2px
2121
$content-padding-top = 30px
22-
23-
// header settings
2422
$header-inner-height = 41px
2523
$heading-padding-vertical = 10px
2624
$header-height = $header-inner-height + $heading-padding-vertical * 2
2725
$mobile-header-height = 40px
28-
// prevent headers from being covered by the top nav upon navigation
29-
$heading-link-padding-top = $header-height + $content-padding-top
30-
$mobile-heading-link-padding-top = $mobile-header-height + $content-padding-top
26+
$heading-link-padding-top = $content-padding-top
27+
$mobile-heading-link-padding-top = $content-padding-top
3128
$h2-margin-top = 45px
3229
$h3-margin-top = 52px

themes/vue/source/css/page.styl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@
5151
h1
5252
margin: 0 0 1em
5353
h2, h3
54-
pointer-events: none
55-
a
56-
pointer-events: auto
57-
color: $dark
5854
&:before
5955
content: ""
6056
display: block
@@ -65,9 +61,11 @@
6561
margin: $h2-margin-top 0 .8em
6662
padding-bottom: .7em
6763
border-bottom: 1px solid $border
64+
z-index: -1
6865
h3
6966
margin: $h3-margin-top 0 1.2em
7067
position: relative
68+
z-index: -1
7169
&:after
7270
content: "#"
7371
color: $green

themes/vue/source/js/common.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(function () {
2+
23
initMobileMenu()
34
if (PAGE_TYPE) {
45
initVersionSelect()
@@ -25,7 +26,7 @@
2526
})
2627
}
2728

28-
function createSourceSearchPath (query) {
29+
function createSourceSearchPath(query) {
2930
query = query
3031
.replace(/\([^\)]*?\)/g, '')
3132
.replace(/(Vue\.)(\w+)/g, '$1$2" OR "$2')
@@ -247,7 +248,7 @@
247248
}
248249
}
249250
if (last)
250-
setActive(last.id, !hoveredOverSidebar)
251+
setActive(last.id, !hoveredOverSidebar)
251252
}
252253

253254
function makeLink (h) {
@@ -333,17 +334,8 @@
333334
function makeHeaderClickable (link) {
334335
var wrapper = link.querySelector('a')
335336
wrapper.setAttribute('data-scroll', '')
336-
337-
// transform DOM structure from
338-
// `<h2><a></a>Header</a>` to <h2><a>Header</a></h2>`
339-
// to make the link clickable
340-
var nodes = link.childNodes
341-
for (var i = 0; i < nodes.length; i++) {
342-
var node = nodes[i]
343-
if (node !== wrapper) {
344-
wrapper.appendChild(node)
345-
}
346-
}
337+
link.parentNode.insertBefore(wrapper, link)
338+
wrapper.appendChild(link)
347339
}
348340
}
349341
})()

0 commit comments

Comments
 (0)
0