File tree Expand file tree Collapse file tree 3 files changed +29
-7
lines changed Expand file tree Collapse file tree 3 files changed +29
-7
lines changed Original file line number Diff line number Diff line change 11<template >
2- <div class =" navigator" >
2+ <div class =" navigator" :style = " { '--sticky-top-offset': topOffset } " >
33 <NavigatorCard
44 :technology =" technology.title"
55 :kind =" technology.kind"
@@ -48,8 +48,22 @@ export default {
4848 data () {
4949 return {
5050 filter: ' ' ,
51+ topOffset: ' 0px' ,
5152 };
5253 },
54+ mounted () {
55+ const anchor = document .getElementById (' nav-sticky-anchor' );
56+ if (anchor .offsetTop === 0 ) return ;
57+ const cb = () => {
58+ const y = Math .max (document .getElementById (' nav-sticky-anchor' ).getBoundingClientRect ().y , 0 );
59+ this .topOffset = ` ${ y} px` ;
60+ };
61+ window .addEventListener (' scroll' , cb);
62+ cb ();
63+ this .$once (' hook:beforeDestroy' , () => {
64+ window .removeEventListener (' scroll' , cb);
65+ });
66+ },
5367 computed: {
5468 // filters the children based on the filter input
5569 filteredTree ({ technology, filter }) {
@@ -91,14 +105,18 @@ export default {
91105@import ' docc-render/styles/_core.scss' ;
92106
93107.navigator {
94- overflow : hidden auto ;
95108 position : sticky ;
96109 top : $nav-height ;
97- max-height : calc (100vh - #{$nav-height } );
110+ max-height : calc (100vh - #{$nav-height } - var (--sticky-top-offset ));
111+ height : 100% ;
112+ padding-bottom : 50px ;
113+ box-sizing : border-box ;
98114}
99115
100116.navigator-filter {
101- position : sticky ;
117+ position : absolute ;
118+ width : 100% ;
119+ box-sizing : border-box ;
102120 bottom : 0 ;
103121 z-index : 1 ;
104122 padding : 8px 20px ;
Original file line number Diff line number Diff line change 88/**
99 * Component used to mark plain text, based on a provided matcher string.
1010 */
11+
12+ import { escapeHtml } from ' docc-render/utils/strings' ;
13+
1114export default {
1215 name: ' HighlightMatch' ,
1316 props: {
@@ -28,8 +31,8 @@ export default {
2831 * @return {string}
2932 */
3033 parsedText : ({ matcher, text }) => (matcher
31- ? text .replace (matcher, match => ` <span class="match">${ match} </span>` )
32- : text),
34+ ? text .replace (matcher, match => ` <span class="match">${ escapeHtml ( match) } </span>` )
35+ : escapeHtml ( text) ),
3336 },
3437};
3538 </script >
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ export default {
6767@import ' docc-render/styles/_core.scss' ;
6868
6969.navigator-card {
70- overflow : hidden ;
70+ overflow : hidden auto ;
71+ height : 100% ;
7172
7273 .head-wrapper {
7374 padding : 10px 20px ;
You can’t perform that action at this time.
0 commit comments