mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-24 15:40:15 +01:00
Fix requirement for Math.sign
This commit is contained in:
parent
f71359ce65
commit
b09e334f3f
File diff suppressed because one or more lines are too long
@ -19,7 +19,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<link rel="shortcut icon" href="{{ base_url }}/assets/images/favicon.ico">
|
<link rel="shortcut icon" href="{{ base_url }}/assets/images/favicon.ico">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<meta name="generator" content="mkdocs+mkdocs-material#1.0.2">
|
<meta name="generator" content="mkdocs+mkdocs-material#1.0.3">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block htmltitle %}
|
{% block htmltitle %}
|
||||||
{% if page.title %}
|
{% if page.title %}
|
||||||
@ -124,7 +124,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ base_url }}/assets/javascripts/application-eb5283d5b7.js"></script>
|
<script src="{{ base_url }}/assets/javascripts/application-2afe21e0b2.js"></script>
|
||||||
<script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script>
|
<script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script>
|
||||||
{% for path in extra_javascript %}
|
{% for path in extra_javascript %}
|
||||||
<script src="{{ path }}"></script>
|
<script src="{{ path }}"></script>
|
||||||
|
@ -42,7 +42,7 @@ export default class Blur {
|
|||||||
this.offset_ = window.pageYOffset
|
this.offset_ = window.pageYOffset
|
||||||
|
|
||||||
/* Necessary state to correctly reset the index */
|
/* Necessary state to correctly reset the index */
|
||||||
this.dir_ = 0
|
this.dir_ = false
|
||||||
|
|
||||||
/* Index anchor node offsets for fast lookup */
|
/* Index anchor node offsets for fast lookup */
|
||||||
this.anchors_ = [].map.call(this.els_, el => {
|
this.anchors_ = [].map.call(this.els_, el => {
|
||||||
@ -65,12 +65,12 @@ export default class Blur {
|
|||||||
*/
|
*/
|
||||||
update() {
|
update() {
|
||||||
const offset = window.pageYOffset
|
const offset = window.pageYOffset
|
||||||
const dir = Math.sign(this.offset_ - offset)
|
const dir = this.offset_ - offset < 0
|
||||||
|
|
||||||
/* Hack: reset index if direction changed, to catch very fast scrolling,
|
/* Hack: reset index if direction changed, to catch very fast scrolling,
|
||||||
because otherwise we would have to register a timer and that sucks */
|
because otherwise we would have to register a timer and that sucks */
|
||||||
if (this.dir_ !== dir)
|
if (this.dir_ !== dir)
|
||||||
this.index_ = dir < 0
|
this.index_ = dir
|
||||||
? this.index_ = 0
|
? this.index_ = 0
|
||||||
: this.index_ = this.els_.length - 1
|
: this.index_ = this.els_.length - 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user