You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/07/11 04:06:32 UTC
[GitHub] dpogue closed pull request #837: Update docs design to improve
readability
dpogue closed pull request #837: Update docs design to improve readability
URL: https://github.com/apache/cordova-docs/pull/837
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/www/_layouts/docs.html b/www/_layouts/docs.html
index 30f31ba8e..35c1a8a2a 100644
--- a/www/_layouts/docs.html
+++ b/www/_layouts/docs.html
@@ -25,250 +25,248 @@
{% endcomment %}
{% capture PATH_TO_ROOT %}{% for item in my_entry_parts %}{% if forloop.rindex > 1 %}../{% endif %}{% endfor %}{% endcapture %}
-<div class="docs container">
+<div class="docs">
<!-- Table of Contents -->
- <div class="hidden-xs hidden-sm col-md-4 col-lg-3 site-toc-container">
+ <div class="hidden-xs hidden-sm site-toc-container">
{% include toc_recursive_main.html entries=TOCFILE my_entry=MY_ENTRY path_to_root=PATH_TO_ROOT %}
</div>
<!-- Page content -->
- <div class="col-md-8 col-md-offset-4 col-lg-9 col-lg-offset-3 page-content-container container">
- <div class="page-content row">
- <div class="col-md-offset-1 col-md-10">
- <div class="content-header">
-
- <!-- ToC Dropdown (for XS and SM sizes only) -->
- <div class="toc-dropdown dropdown visible-xs-block visible-sm-block">
- <button class="btn btn-default dropdown-toggle" type="button" id="tocDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
- {{ page.toc_text }}
- <span class="caret"></span>
- </button>
- <ul class="dropdown-menu">
- {% include toc_recursive_dropdown.html entries=TOCFILE my_entry=MY_ENTRY path_to_root=PATH_TO_ROOT %}
- </ul>
- </div>
+ <div class="page-content-container">
+ <div class="page-content">
+ <div class="content-header">
+
+ <!-- ToC Dropdown (for XS and SM sizes only) -->
+ <div class="toc-dropdown dropdown visible-xs-block visible-sm-block">
+ <button class="btn btn-default dropdown-toggle" type="button" id="tocDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
+ {{ page.toc_text }}
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu">
+ {% include toc_recursive_dropdown.html entries=TOCFILE my_entry=MY_ENTRY path_to_root=PATH_TO_ROOT %}
+ </ul>
+ </div>
- {% comment %}
- Show a single edit-link if the page has a specific edit-link.
- {% endcomment %}
- {% if page.edit_link %}
- <a class="edit" href="{{ page.edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_text }}</a>
+ {% comment %}
+ Show a single edit-link if the page has a specific edit-link.
+ {% endcomment %}
+ {% if page.edit_link %}
+ <a class="edit hidden-xs hidden-sm" href="{{ page.edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_text }}</a>
- {% comment %}
- Otherwise, show editing and translating options.
+ {% comment %}
+ Otherwise, show editing and translating options.
- Edit-links obey the following rules:
+ Edit-links obey the following rules:
- if page in /dev/ or /latest/:
- show edit link for /dev/ page in source language
- if page not in source language:
- show translation link for /dev/ page
- else:
- show edit link for the page in its version and language
+ if page in /dev/ or /latest/:
+ show edit link for /dev/ page in source language
+ if page not in source language:
+ show translation link for /dev/ page
+ else:
+ show edit link for the page in its version and language
- {% endcomment %}
- {% else %}
+ {% endcomment %}
+ {% else %}
- {% capture base_edit_link %}https://github.com/apache/cordova-docs/tree/master/www/{{ page.path }}{% endcapture %}
- {% capture base_version %}/{{ page.version }}/{% endcapture %}
- {% capture base_language %}/{{ page.language }}/{% endcapture %}
- {% capture dev_version %}/dev/{% endcapture %}
- {% capture src_language %}/{{ site.src_language }}/{% endcapture %}
+ {% capture base_edit_link %}https://github.com/apache/cordova-docs/tree/master/www/{{ page.path }}{% endcapture %}
+ {% capture base_version %}/{{ page.version }}/{% endcapture %}
+ {% capture base_language %}/{{ page.language }}/{% endcapture %}
+ {% capture dev_version %}/dev/{% endcapture %}
+ {% capture src_language %}/{{ site.src_language }}/{% endcapture %}
+
+ {% comment %}
+ Edit-links for current pages in non-source languages
+ NOTE:
+ Pages that are under /dev/ or /latest/ (i.e. site.latest_docs_version) have page.current set to "true".
+ {% endcomment %}
+ {% if page.language != site.src_language and page.current %}
{% comment %}
- Edit-links for current pages in non-source languages
- NOTE:
- Pages that are under /dev/ or /latest/ (i.e. site.latest_docs_version) have page.current set to "true".
+ Compute crowdin link
{% endcomment %}
- {% if page.language != site.src_language and page.current %}
+ {% capture page_path_prefix %}docs/{{ page.language }}/{{ page.version }}{% endcapture %}
+ {% assign page_path_end = page.path | split:"/" | last %}
+ {% assign crowdin_path = page.path | replace:page_path_prefix,"docs/en/dev" | replace:page_path_end,"" %}
+ {% capture crowdin_link %}https://crowdin.com/project/cordova/{{ page.language }}#/cordova-docs/{{ crowdin_path }}{% endcapture %}
- {% comment %}
- Compute crowdin link
- {% endcomment %}
- {% capture page_path_prefix %}docs/{{ page.language }}/{{ page.version }}{% endcapture %}
- {% assign page_path_end = page.path | split:"/" | last %}
- {% assign crowdin_path = page.path | replace:page_path_prefix,"docs/en/dev" | replace:page_path_end,"" %}
- {% capture crowdin_link %}https://crowdin.com/project/cordova/{{ page.language }}#/cordova-docs/{{ crowdin_path }}{% endcapture %}
+ {% assign edit_link = base_edit_link | replace:base_language,src_language | replace:base_version,dev_version %}
- {% assign edit_link = base_edit_link | replace:base_language,src_language | replace:base_version,dev_version %}
+ <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
+ <a class="edit" href="{{ crowdin_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_translation_text }}</a>
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- <a class="edit" href="{{ crowdin_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_translation_text }}</a>
+ {% comment %}
+ Edit-links for all other pages
+ {% endcomment %}
+ {% else %}
{% comment %}
- Edit-links for all other pages
+ Edit-link for latest version points to dev instead
{% endcomment %}
+ {% if page.version == site.latest_docs_version %}
+ {% assign edit_link = base_edit_link | replace:base_version,dev_version %}
{% else %}
-
- {% comment %}
- Edit-link for latest version points to dev instead
- {% endcomment %}
- {% if page.version == site.latest_docs_version %}
- {% assign edit_link = base_edit_link | replace:base_version,dev_version %}
- {% else %}
- {% assign edit_link = base_edit_link %}
- {% endif %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
+ {% assign edit_link = base_edit_link %}
{% endif %}
+
+ <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
{% endif %}
+ {% endif %}
+
+ <!-- Language dropdown -->
+ <div class="dropdown">
+ <button class="btn btn-default dropdown-toggle" type="button" id="languageDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
+ {{ site.data.docs-versions[page.language].name }}
+ <span class="caret"></span>
+ </button>
- <!-- Language dropdown -->
- <div class="dropdown">
- <button class="btn btn-default dropdown-toggle" type="button" id="languageDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
- {{ site.data.docs-versions[page.language].name }}
- <span class="caret"></span>
- </button>
+ <!-- List all languages -->
+ <ul class="dropdown-menu" aria-labelledby="languageDropdown">
+ {% for other_language_entry in site.data.docs-versions %}
- <!-- List all languages -->
- <ul class="dropdown-menu" aria-labelledby="languageDropdown">
- {% for other_language_entry in site.data.docs-versions %}
+ {% assign other_language_id = other_language_entry[0] %}
+ {% assign other_language = other_language_entry[1] %}
+ {% assign other_language_versions = other_language.versions %}
+ {% assign other_language_name = other_language.name %}
+
+ {% capture other_language_root %}/docs/{{ other_language_id }}/{% endcapture %}
+
+ {% comment %}
+ Replace only the language part of the URI, thereby redirecting to the same page
+ in the other language. The page will exist because translations are clones of each other.
+ {% endcomment %}
+ {% assign other_language_url = page.url | replace:LANGUAGE_ROOT,other_language_root %}
- {% assign other_language_id = other_language_entry[0] %}
- {% assign other_language = other_language_entry[1] %}
- {% assign other_language_versions = other_language.versions %}
- {% assign other_language_name = other_language.name %}
+ <li>
+ <a href="{{ site.baseurl }}{{ other_language_url }}" class="{% unless other_language_versions contains page.version %}missing-page{% endunless %}">
+ {% if page.language == other_language_id %}
+ <span class="selected">
+ {{ other_language_name }}
+ </span>
+ {% else %}
+ {{ other_language_name }}
+ {% endif %}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
- {% capture other_language_root %}/docs/{{ other_language_id }}/{% endcapture %}
+ <!-- Version dropdown -->
+ <div class="dropdown">
+ <button class="btn btn-default dropdown-toggle" type="button" id="versionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
+ {{ page.version }}
+ {% if page.version == site.latest_docs_version %}
+ ({{ page.latest_text }})
+ {% endif %}
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" aria-labelledby="versionDropdown">
+ <!-- List versions available in this language -->
+ {% for other_version in site.data.docs-versions[page.language].versions reversed %}
+ <li>
{% comment %}
- Replace only the language part of the URI, thereby redirecting to the same page
- in the other language. The page will exist because translations are clones of each other.
+ Name the latest version as "latest" to take advantage of redirects for "/latest/".
{% endcomment %}
- {% assign other_language_url = page.url | replace:LANGUAGE_ROOT,other_language_root %}
-
- <li>
- <a href="{{ site.baseurl }}{{ other_language_url }}" class="{% unless other_language_versions contains page.version %}missing-page{% endunless %}">
- {% if page.language == other_language_id %}
- <span class="selected">
- {{ other_language_name }}
- </span>
- {% else %}
- {{ other_language_name }}
- {% endif %}
- </a>
- </li>
- {% endfor %}
- </ul>
- </div>
-
- <!-- Version dropdown -->
- <div class="dropdown">
- <button class="btn btn-default dropdown-toggle" type="button" id="versionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
- {{ page.version }}
- {% if page.version == site.latest_docs_version %}
- ({{ page.latest_text }})
+ {% if other_version == site.latest_docs_version %}
+ {% assign other_version_string = "latest" %}
+ {% else %}
+ {% assign other_version_string = other_version %}
{% endif %}
- <span class="caret"></span>
- </button>
- <ul class="dropdown-menu" aria-labelledby="versionDropdown">
-
- <!-- List versions available in this language -->
- {% for other_version in site.data.docs-versions[page.language].versions reversed %}
- <li>
- {% comment %}
- Name the latest version as "latest" to take advantage of redirects for "/latest/".
- {% endcomment %}
+
+ {% capture version_entry_string %}
+ {{ other_version }}
{% if other_version == site.latest_docs_version %}
- {% assign other_version_string = "latest" %}
- {% else %}
- {% assign other_version_string = other_version %}
+ ({{ page.latest_text }})
{% endif %}
+ {% endcapture %}
- {% capture version_entry_string %}
- {{ other_version }}
- {% if other_version == site.latest_docs_version %}
- ({{ page.latest_text }})
- {% endif %}
- {% endcapture %}
-
- {% comment %}
- Replace only the version part of the URI, thereby redirecting to
- the same page in the other version.
-
- NOTE:
- This page might not exist in the target version because page
- layouts change from version to version
- {% endcomment %}
- {% capture other_version_root %}/docs/{{ page.language }}/{{ other_version_string }}/{% endcapture %}
- {% assign other_version_url = page.url | replace:VERSION_ROOT,other_version_root %}
-
- {% unless ALL_PAGES contains other_version_url %}
- {% assign other_version_url = other_version_root %}
- {% endunless %}
-
- <a href="{{ site.baseurl }}{{ other_version_url }}" class="{% unless ALL_PAGES contains other_version_url %}missing-page{% endunless %}">
- {% if page.version == other_version %}
- <span class="selected">
- {{ version_entry_string }}
- </span>
- {% else %}
- {{ version_entry_string }}
- {% endif %}
- </a>
- </li>
- {% endfor %}
- </ul>
- </div>
- </div>
-
- {% comment %}
- Get URL for this page in the latest version
- {% endcomment %}
- {% capture latest_root %}/docs/{{ page.language }}/latest/{% endcapture %}
- {% assign latest_url = page.url | replace:VERSION_ROOT,latest_root %}
+ {% comment %}
+ Replace only the version part of the URI, thereby redirecting to
+ the same page in the other version.
- {% comment %}
- If this page doesn't exist, just use root
- {% endcomment %}
- {% unless ALL_PAGES contains latest_url %}
- {% assign latest_url = latest_root %}
- {% endunless %}
-
- <!-- Show warnings for special versions -->
- <!-- dev warning -->
- {% if page.version == 'dev' %}
- <div class="alert docs-alert alert-info" role="alert">
- <button type="button" class="close" data-dismiss="alert" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- {{ page.in_development_text }}
- <a href="{{ site.baseurl }}{{ latest_url }}">
- {{ page.click_here_text }}
- </a>
- </div>
- {% endif %}
+ NOTE:
+ This page might not exist in the target version because page
+ layouts change from version to version
+ {% endcomment %}
+ {% capture other_version_root %}/docs/{{ page.language }}/{{ other_version_string }}/{% endcapture %}
+ {% assign other_version_url = page.url | replace:VERSION_ROOT,other_version_root %}
- <!-- outdated warning -->
- {% if page.version != 'dev' and page.version != site.latest_docs_version %}
- <div class="alert docs-alert alert-danger" role="alert">
- <button type="button" class="close" data-dismiss="alert" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- {{ page.outdated_text }}
- <a href="{{ site.baseurl }}{{ latest_url }}">
- {{ page.click_here_text }}
- </a>
- </div>
- {% endif %}
+ {% unless ALL_PAGES contains other_version_url %}
+ {% assign other_version_url = other_version_root %}
+ {% endunless %}
- <!-- plugin version warning -->
- {% if page.plugin_name and page.plugin_version %}
- <div class="alert alert-warning docs-alert" role="alert">
- <button type="button" class="close" data-dismiss="alert" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- {{ page.plugin_version_text }} {{ page.plugin_version }}.
- <a href="https://github.com/apache/{{ page.plugin_name }}/releases">
- {{ page.visit_github_text }}
- </a>
- </div>
- {% endif %}
+ <a href="{{ site.baseurl }}{{ other_version_url }}" class="{% unless ALL_PAGES contains other_version_url %}missing-page{% endunless %}">
+ {% if page.version == other_version %}
+ <span class="selected">
+ {{ version_entry_string }}
+ </span>
+ {% else %}
+ {{ version_entry_string }}
+ {% endif %}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
- <div id="page-toc-source">
- {{ content }}
+ {% comment %}
+ Get URL for this page in the latest version
+ {% endcomment %}
+ {% capture latest_root %}/docs/{{ page.language }}/latest/{% endcapture %}
+ {% assign latest_url = page.url | replace:VERSION_ROOT,latest_root %}
+
+ {% comment %}
+ If this page doesn't exist, just use root
+ {% endcomment %}
+ {% unless ALL_PAGES contains latest_url %}
+ {% assign latest_url = latest_root %}
+ {% endunless %}
+
+ <!-- Show warnings for special versions -->
+ <!-- dev warning -->
+ {% if page.version == 'dev' %}
+ <div class="alert docs-alert alert-info" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">×</span>
+ </button>
+ {{ page.in_development_text }}
+ <a href="{{ site.baseurl }}{{ latest_url }}">
+ {{ page.click_here_text }}
+ </a>
</div>
+ {% endif %}
+
+ <!-- outdated warning -->
+ {% if page.version != 'dev' and page.version != site.latest_docs_version %}
+ <div class="alert docs-alert alert-danger" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">×</span>
+ </button>
+ {{ page.outdated_text }}
+ <a href="{{ site.baseurl }}{{ latest_url }}">
+ {{ page.click_here_text }}
+ </a>
+ </div>
+ {% endif %}
+
+ <!-- plugin version warning -->
+ {% if page.plugin_name and page.plugin_version %}
+ <div class="alert alert-warning docs-alert" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">×</span>
+ </button>
+ {{ page.plugin_version_text }} {{ page.plugin_version }}.
+ <a href="https://github.com/apache/{{ page.plugin_name }}/releases">
+ {{ page.visit_github_text }}
+ </a>
+ </div>
+ {% endif %}
+
+ <div id="page-toc-source">
+ {{ content }}
</div>
</div>
<div class="row">
diff --git a/www/static/css-src/_docs.scss b/www/static/css-src/_docs.scss
index e668111c1..0956a2c9d 100644
--- a/www/static/css-src/_docs.scss
+++ b/www/static/css-src/_docs.scss
@@ -1,18 +1,30 @@
.docs {
+ $toc-width: 320px;
+
+ display: flex;
+ justify-content: center;
width: 100%;
height: 100%;
- margin: 0px;
- padding: 0px;
+ margin: 0;
+ padding: 0;
font-family: "Raleway", Helvetica, Arial, sans-serif;
+ font-size: 18px;
+ line-height: 1.6;
+
+ @media (max-width: 991px) {
+ font-size: 16px;
+ }
- /* this is so that wide images don't stick out of their paragraphs */
p {
+ margin-bottom: .8em;
+
img {
max-width: 100%;
}
}
pre {
+ margin: 15px 0;
word-wrap: normal;
code {
@@ -69,45 +81,41 @@
/* outer ToC for the site */
.site-toc-container {
position: fixed;
- height: 100%;
+ top: 50px;
+ left: 0;
+ height: calc(100% - 50px);
+ width: $toc-width;
overflow-y: scroll;
+ overflow-x: hidden;
background: $gray-85;
.site-toc {
-
- /* NOTE: the bottom padding is special because it offsets the header */
- padding-top: 35px;
- padding-bottom: 80px;
- padding-left: 55px;
- padding-right: 10px;
+ padding: 10px 15px;
li {
list-style: none;
}
+
> li {
font-size: 16px;
- font-weight: 600;
padding-top: 0.05em;
line-height: 30px;
a {
color: white;
+ display: block;
+ padding: 0 50%;
+ margin: 0 -50%;
+
&.this-page {
font-weight: bold;
+ background-color: $brand-primary-darker;
}
}
- .entry-highlight {
- width: 200%;
- position: absolute;
- height: 31px;
- background-color: #d60c3f;
- opacity: 0.7;
- margin-left: -100%;
- z-index: -1;
- }
}
.toc-section-heading {
- font-size: 30px;
- font-weight: 300;
+ font-size: 18px;
+ font-weight: 600;
+ text-transform: uppercase;
margin: 0.3em 0em 0.3em 0em;
display: block;
color: $brand-primary;
@@ -115,51 +123,50 @@
/* NOTE: this is not a mistake; .site-toc gets nested inside itself */
.site-toc {
- padding-left: 15px;
- padding-right: 0px;
- padding-top: 0px;
- padding-bottom: 0px;
+ padding: 0 0 0 10px;
+
.toc-section-heading {
font-size: 16px;
font-weight: 600;
+ text-transform: none;
}
}
}
- }
- /* non-IE scrollbar styling */
- .site-toc-container::-webkit-scrollbar {
- width: 13px; /* for vertical scrollbars */
- height: 13px; /* for horizontal scrollbars */
- }
- .site-toc-container::-webkit-scrollbar-track {
- background-color: black;
- }
- .site-toc-container::-webkit-scrollbar-thumb {
- background-color: $gray-70;
- }
-
- /* IE-only scrollbar styling */
- .site-toc-container {
- scrollbar-arrow-color: $gray-70;
- scrollbar-face-color: $gray-70;
- scrollbar-highlight-color: black;
- scrollbar-shadow-color: $gray-70;
+ // Only the top level table of contents
+ > .site-toc {
+ > li {
+ margin-bottom: 1rem;
+ }
+ }
}
.page-content-container {
- padding: 0px;
+ margin-left: $toc-width;
+ width: calc(100% - #{$toc-width});
+
+ @media (max-width: 991px) {
+ margin-left: 0;
+ width: 100%;
+ }
+
.page-content {
- margin-bottom: 20px;
+ width: 960px;
+ max-width: 100%;
+ margin: 0 auto 50px;
+ padding: 0 50px;
+
+ @media (max-width: 991px) {
+ padding: 0 15px;
+ }
+
.header-link {
position: relative;
left: 0.5em;
opacity: 0;
font-size: 0.7em;
- -webkit-transition: opacity 0.2s ease-in-out 0.1s;
- -moz-transition: opacity 0.2s ease-in-out 0.1s;
- -ms-transition: opacity 0.2s ease-in-out 0.1s;
+ transition: opacity 0.2s ease-in-out 0.1s;
}
h1:hover .header-link,
h2:hover .header-link,
@@ -173,7 +180,7 @@
color: #2C7185;
}
h1 {
- font-size: 48px;
+ font-size: 42px;
font-weight: 300;
}
h2 {
@@ -187,6 +194,12 @@
h3, h4, h5, h6 {
font-weight: 600;
}
+ h4 {
+ margin-top: 20px;
+ }
+ h5 {
+ margin-top: 16px;
+ }
}
}
@@ -267,6 +280,7 @@
table {
@extend .table;
@extend .table-bordered;
+ margin: 20px 0;
}
.docs-alert {
@@ -390,6 +404,10 @@
height: 120px;
}
}
+
+ footer {
+ font-size: 14px;
+ }
}
@media (max-width: $screen-sm-max) {
diff --git a/www/static/js/docs.js b/www/static/js/docs.js
index 13095259a..c3304752d 100644
--- a/www/static/js/docs.js
+++ b/www/static/js/docs.js
@@ -32,13 +32,13 @@ var platforms = {
$(document).ready(function () {
- var HEADER_OFFSET = 56; // in pixels
- var TOC_TOP_OFFSET = HEADER_OFFSET + 55;
+ var HEADER_OFFSET = 50; // in pixels
+ var TOC_TOP_OFFSET = HEADER_OFFSET + 40;
// if this page's ToC entry can be found, scroll the ToC to it
- var thisPageEntry = $(".this-page");
+ var thisPageEntry = $(".site-toc-container .this-page");
if (thisPageEntry.length > 0) {
- $(".site-toc-container").scrollTop(thisPageEntry.first().offset().top - TOC_TOP_OFFSET);
+ $(".site-toc-container").scrollTop(thisPageEntry.first().position().top - TOC_TOP_OFFSET);
}
function slugifyLikeGitHub(originalText) {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org