mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed disappearance of tabs for smaller font sizes
This commit is contained in:
parent
bc46b87d6a
commit
9d1390f318
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -193,7 +193,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/application.d5a09f94.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/application.ffb616e8.js' | url }}"></script>
|
||||
{% if lang.t("search.language") != "en" %}
|
||||
{% set languages = lang.t("search.language").split(",") %}
|
||||
{% if languages | length and languages[0] != "" %}
|
||||
|
@ -32,6 +32,7 @@ export default class Toggle {
|
||||
* @constructor
|
||||
*
|
||||
* @property {HTMLElement} el_ - Content container
|
||||
* @property {number} height_ - Header height
|
||||
* @property {number} offset_ - Toggle page-y offset
|
||||
* @property {boolean} active_ - Tabs visibility
|
||||
*
|
||||
@ -45,7 +46,11 @@ export default class Toggle {
|
||||
throw new ReferenceError
|
||||
this.el_ = ref
|
||||
|
||||
/* Initialize offset and state */
|
||||
/* Obtain header */
|
||||
const header = document.querySelector("[data-md-component=header]")
|
||||
|
||||
/* Initialize height and state */
|
||||
this.height_ = header.offsetHeight
|
||||
this.active_ = false
|
||||
}
|
||||
|
||||
@ -54,7 +59,7 @@ export default class Toggle {
|
||||
*/
|
||||
update() {
|
||||
const active = window.pageYOffset >=
|
||||
this.el_.children[0].offsetTop + (5 - 48) // TODO: quick hack to enable same handling for hero
|
||||
this.el_.children[0].offsetTop + (5 - this.height_)
|
||||
if (active !== this.active_)
|
||||
this.el_.dataset.mdState = (this.active_ = active) ? "hidden" : ""
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user