mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-25 20:48:11 +00:00
Merge pull request #425 from vincent99/master
Only show "On this page" if there are links to show
This commit is contained in:
@@ -36,4 +36,5 @@ RUN stat /run/public/index.html
|
||||
FROM nginx
|
||||
VOLUME /usr/share/nginx/html/docs
|
||||
COPY --from=build /run/public /usr/share/nginx/html/docs/
|
||||
COPY gulpfile.babel.js /usr/share/nginx/html/docs/
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
@@ -35,4 +35,5 @@ RUN stat /run/public/index.html
|
||||
FROM nginx
|
||||
VOLUME /usr/share/nginx/html/docs
|
||||
COPY --from=build /run/public /usr/share/nginx/html/docs/
|
||||
COPY gulpfile.babel.js /usr/share/nginx/html/docs/
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
+13
-5
@@ -65,18 +65,26 @@ const bootstrapDocsSearch = function() {
|
||||
overlay.toggleClass('open');
|
||||
|
||||
if (container.hasClass('open')) {
|
||||
$('input#search').focus();
|
||||
$('input#search-box').focus();
|
||||
}
|
||||
|
||||
overlay.css({top: 120});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
const bootstrapDocsJS = function() {
|
||||
bootstrapDocsSearch();
|
||||
const bootstrapIdLinks = function() {
|
||||
const container = '.wrapper ARTICLE';
|
||||
const selector = 'h2[id], h3[id], h4[id], h5[id], h6[id]';
|
||||
$(container).on('mouseenter', selector, function(e) {
|
||||
$(e.target).append($('<a />').addClass('header-anchor').attr('href', '#' + e.target.id).html('<i class="material-icons p-l-xs" aria-hidden="true">link</i>'));
|
||||
});
|
||||
|
||||
$(container).on('mouseleave', selector, function(e) {
|
||||
$(e.target).parent().find('.header-anchor').remove();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(() => {
|
||||
bootstrapDocsJS();
|
||||
bootstrapDocsSearch();
|
||||
bootstrapIdLinks();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user