Skip to content

Commit

Permalink
Tweaking the css and js of the docs to get them right when live on RT…
Browse files Browse the repository at this point in the history
…D [skip ci]
  • Loading branch information
DominicWatson committed Jan 24, 2015
1 parent 35f1f9b commit e66d92d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
border-color: #2C3D4E;
}

.wy-grid-for-nav,
.wy-grid-for-nav .stickynav {
.wy-grid-for-nav {
top : 51px;
}

Expand Down
95 changes: 26 additions & 69 deletions support/docs/source/_themes/pixl8_rtd_theme/static/js/theme.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,34 @@
// $( document ).ready(function() {
// // Shift nav in mobile when clicking the menu.
// $(document).on('click', "[data-toggle='wy-nav-top']", function() {
// $("[data-toggle='wy-nav-shift']").toggleClass("shift");
// $("[data-toggle='rst-versions']").toggleClass("shift");
// });
// // Close menu when you click a link.
// $(document).on('click', ".wy-menu-vertical .current ul li a", function() {
// $("[data-toggle='wy-nav-shift']").removeClass("shift");
// $("[data-toggle='rst-versions']").toggleClass("shift");
// });
// // Make tables responsive
// $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
$( document ).ready(function() {
// crazy TOC hack
var $pageToc = $( '#page-toc' )
, $pageTitle = $pageToc.prev().find( "h1:first" );

// // crazy TOC hack
// var $pageToc = $( '#page-toc' )
// , $pageTitle = $pageToc.prev().find( "h1:first" );
$pageToc.insertAfter( $pageTitle );
});

// $pageToc.insertAfter( $pageTitle );
// });
( function( $ ){

// window.SphinxRtdTheme = (function (jquery) {
// var stickyNav = (function () {
// var navBar,
// win,
// stickyNavCssClass = 'stickynav',
// applyStickNav = function () {
// if (navBar.height() <= win.height()) {
// navBar.addClass(stickyNavCssClass);
// } else {
// navBar.removeClass(stickyNavCssClass);
// }
// },
// enable = function () {
// applyStickNav();
// win.on('resize', applyStickNav);
// },
// init = function () {
// navBar = jquery('nav.wy-nav-side:first');
// win = jquery(window);
// };
// jquery(init);
// return {
// enable : enable
// };
// }());
// return {
// StickyNav : stickyNav
// };
// }($));
function scroll_if_anchor( href ) {
href = typeof(href) == "string" ? href : $(this).attr("href");

// ( function( $ ){
var fromTop = 65;

// function scroll_if_anchor( href ) {
// href = typeof(href) == "string" ? href : $(this).attr("href");
if ( href.indexOf( "#" ) == 0 ) {
var $target = $(href);

// var fromTop = 65;
if ( $target.length ) {
$('html, body').animate( { scrollTop: $target.offset().top - fromTop } );
if ( history && "pushState" in history ) {
history.pushState( {}, document.title, window.location.pathname + href );
return false;
}
}
}
}

// if ( href.indexOf( "#" ) == 0 ) {
// var $target = $(href);
$( "body" ).on( "click", "a", scroll_if_anchor );

// if ( $target.length ) {
// $('html, body').animate( { scrollTop: $target.offset().top - fromTop } );
// if ( history && "pushState" in history ) {
// history.pushState( {}, document.title, window.location.pathname + href );
// return false;
// }
// }
// }
// }

// $( "body" ).on( "click", "a", scroll_if_anchor );

// $( function(){
// scroll_if_anchor( window.location.hash );
// } );
// } )( jQuery );
$( function(){
scroll_if_anchor( window.location.hash );
} );
} )( jQuery );

0 comments on commit e66d92d

Please sign in to comment.