Skip to content

Commit

Permalink
merge fixes for new navigation bar to right-to-left style
Browse files Browse the repository at this point in the history
  • Loading branch information
michael63-osm committed Jun 17, 2018
1 parent 6b7812d commit 4188bd5
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions _layouts/doc-rtl.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@
<span>{{ post.title }}</span>
</a>
{% if post.category == page.category %}
<!-- for the current category we show an indented menu with the names of all guides contained -->
<!-- for the current category we show an indented menu with the names of all guides contained;
we need to reference the second guide of the current category for the 'proceed-to' link later -->
{% assign first_guide = "0" %}
{% for subpost in site.categories[page.category] %}
{% if subpost.lang == page.lang %}{% unless subpost.cover or subpost.hidden %}
<li class='doc doc-nav-secondary rounded'>
<a class='title {% if page.url == subpost.url %}active{% endif %}' href="{{site.baseurl}}{{ subpost.url }}">
{% if first_guide == "0" %}
<a class='title {% if page.url == subpost.url %}active{% endif %} doc-first-guide' href="{{site.baseurl}}{{ subpost.url }}">
<span>{{ subpost.title }}</span>
</a>
</a>
{% assign first_guide = "1" %}
{% else %}
<a class='title {% if page.url == subpost.url %}active{% endif %}' href="{{site.baseurl}}{{ subpost.url }}">
<span>{{ subpost.title }}</span>
</a>
{% endif %}
</li>
{% endunless %}{% endif %}
{% endfor %}
Expand Down Expand Up @@ -93,7 +102,6 @@
$('img').parent().addClass('has-image');

// make title nav sticky
{% unless page.cover %} // excluding cover pages
$(document).ready(function(){
var nav = $('.doc-nav'),
navTop = nav.offset().top,
Expand Down Expand Up @@ -121,9 +129,8 @@
}
});
});
{% endunless %}
// get the second url of doc nav and make it the url of the 'proceed' link
var proceedTo = $('.doc-nav li:nth-child(2) a').attr('href');
// get the second url of the current-chapter-nav and make it the url of the 'proceed' link
var proceedTo = $('.doc-first-guide').attr('href');
$('a.start').attr('href',proceedTo);
// Set the min-height of the page dynamically based on height of navigation div
$('.doc-main-rtl').css("min-height", function() {
Expand Down

0 comments on commit 4188bd5

Please sign in to comment.